From cfec9c08ed44b01c9559a3256c8df54162746c9c Mon Sep 17 00:00:00 2001 From: Shawn Stephens Date: Mon, 23 Jan 2023 16:40:32 -0600 Subject: [PATCH 1/5] Make quiet optional since some older apps like Spectre have dependencies that require Hashie < 4.0. --- lib/setting.rb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/setting.rb b/lib/setting.rb index 7cff3a3..4161827 100644 --- a/lib/setting.rb +++ b/lib/setting.rb @@ -82,7 +82,7 @@ def self.available_settings #================================================================= def initialize - @available_settings ||= Hashie::Mash.quiet(:default).new + @available_settings ||= new_available_settings end def has_key?(key) @@ -146,7 +146,7 @@ def loaded? def load(params) # reset settings hash - @available_settings = Hashie::Mash.quiet(:default).new + @available_settings = new_available_settings @loaded = false files = [] @@ -177,4 +177,14 @@ def load(params) @loaded = true @available_settings end + + private + + def new_available_settings + if Hashie::Mash.respond_to?(:quiet) + Hashie::Mash.quiet(:default).new + else + Hashie::Mash.new + end + end end From 47389095b33b3b0a38ddc6c29201651d7e6e404d Mon Sep 17 00:00:00 2001 From: Shawn Stephens Date: Mon, 23 Jan 2023 16:49:43 -0600 Subject: [PATCH 2/5] Remove Hashie 4.0 requirement for gemspec --- fittings.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fittings.gemspec b/fittings.gemspec index 170a97e..e0054bf 100644 --- a/fittings.gemspec +++ b/fittings.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] s.required_ruby_version = ">= 2.4.0" - s.add_dependency("hashie", ">= 4.0") + s.add_dependency("hashie") s.add_development_dependency "rspec" s.add_development_dependency "rake" s.add_development_dependency "rdoc" From 7f2703f6af8e5999f102aa4656363852e6d587a5 Mon Sep 17 00:00:00 2001 From: Shawn Stephens Date: Mon, 23 Jan 2023 16:53:57 -0600 Subject: [PATCH 3/5] Add comment to explain when quiet can become the default. --- lib/setting.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/setting.rb b/lib/setting.rb index 4161827..b569332 100644 --- a/lib/setting.rb +++ b/lib/setting.rb @@ -181,6 +181,9 @@ def load(params) private def new_available_settings + # Spectre and other monoliths are tied to Hashie 3.x + # so once that isn't a problem and all apps can use Hashie >= 4.0 + # then then Hashie::Mash.quiet can become the default. if Hashie::Mash.respond_to?(:quiet) Hashie::Mash.quiet(:default).new else From fa65eba1a156038704941ffa9832d84ffcb521ac Mon Sep 17 00:00:00 2001 From: Shawn Stephens Date: Mon, 23 Jan 2023 17:02:37 -0600 Subject: [PATCH 4/5] RC 1 --- fittings.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fittings.gemspec b/fittings.gemspec index e0054bf..58a25d4 100644 --- a/fittings.gemspec +++ b/fittings.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "fittings" - s.version = "3.0.1" + s.version = "3.0.2.RC1" s.authors = ["Edwin Cruz", "Colin Shield"] s.date = %q{2011-09-06} From bf0286b45aaa67e52fd29a3a12643aacc6e28361 Mon Sep 17 00:00:00 2001 From: Shawn Stephens Date: Mon, 23 Jan 2023 18:50:32 -0600 Subject: [PATCH 5/5] Manually update version since stitchfix-y isn't used here --- fittings.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fittings.gemspec b/fittings.gemspec index 58a25d4..fa541c8 100644 --- a/fittings.gemspec +++ b/fittings.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "fittings" - s.version = "3.0.2.RC1" + s.version = "3.0.2" s.authors = ["Edwin Cruz", "Colin Shield"] s.date = %q{2011-09-06}