From 6632d6256e79663d1384d60fa752fe95fae1f654 Mon Sep 17 00:00:00 2001 From: Neil Matatall Date: Wed, 26 Aug 2015 14:58:39 -0700 Subject: [PATCH 1/2] add post install message warning about dropping 1.8.7 support Fixes #154 --- lib/secure_headers/version.rb | 2 +- secure_headers.gemspec | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/secure_headers/version.rb b/lib/secure_headers/version.rb index 97a63c67..767e57ce 100644 --- a/lib/secure_headers/version.rb +++ b/lib/secure_headers/version.rb @@ -1,3 +1,3 @@ module SecureHeaders - VERSION = "2.2.3" + VERSION = "2.2.4" end diff --git a/secure_headers.gemspec b/secure_headers.gemspec index 32c46b31..0c4cde83 100644 --- a/secure_headers.gemspec +++ b/secure_headers.gemspec @@ -20,4 +20,5 @@ Gem::Specification.new do |gem| gem.require_paths = ["lib"] gem.add_development_dependency "rake" gem.add_dependency "user_agent_parser" + gem.post_install_message = "Heads up, secure_headers Ruby 1.8.7 support will go away in the next major release." end From 3bdcc4fe538bbdb828288f04d984b9affa0ee2be Mon Sep 17 00:00:00 2001 From: Neil Matatall Date: Wed, 26 Aug 2015 16:27:39 -0700 Subject: [PATCH 2/2] print deprecation warning at runtime instead of during gem installation --- lib/secure_headers.rb | 3 +++ secure_headers.gemspec | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/secure_headers.rb b/lib/secure_headers.rb index e0e6142f..10ad906c 100644 --- a/lib/secure_headers.rb +++ b/lib/secure_headers.rb @@ -39,6 +39,9 @@ def secure_headers_options end def ensure_security_headers options = {} + if RUBY_VERSION == "1.8.7" + warn "[DEPRECATION] secure_headers ruby 1.8.7 support will dropped in the next release" + end self.secure_headers_options = options before_filter :prep_script_hash before_filter :set_hsts_header diff --git a/secure_headers.gemspec b/secure_headers.gemspec index 0c4cde83..32c46b31 100644 --- a/secure_headers.gemspec +++ b/secure_headers.gemspec @@ -20,5 +20,4 @@ Gem::Specification.new do |gem| gem.require_paths = ["lib"] gem.add_development_dependency "rake" gem.add_dependency "user_agent_parser" - gem.post_install_message = "Heads up, secure_headers Ruby 1.8.7 support will go away in the next major release." end