From 2b987183f962736c029ecc92f48a26617b2cd4ad Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 20 Oct 2017 16:25:38 +0000 Subject: [PATCH] Update gemfile to point at railsconfig/config#180 branch. Remove monkeypatch --- Gemfile | 5 ++++- Gemfile.lock | 19 +++++++++++------ config/initializers/config_monkeypatch.rb | 26 ----------------------- 3 files changed, 17 insertions(+), 33 deletions(-) delete mode 100644 config/initializers/config_monkeypatch.rb diff --git a/Gemfile b/Gemfile index 11114aaa9..f74fe9f43 100644 --- a/Gemfile +++ b/Gemfile @@ -83,7 +83,10 @@ gem 'devise-i18n' gem 'devise_invitable', '~> 1.6' gem 'apartment' -gem 'config', '~> 1.2', '>= 1.2.1' +# Until 'config' fixes issues with parsing boolean environment variables, +# we have to use a patched branch. See https://github.com/railsconfig/config/pull/180 +gem 'config', github: 'mjgiarlo/config', branch: 'parse_boolean_env_values' +# gem 'config', '~> 1.2', '>= 1.2.1' gem 'is_it_working' gem 'rolify' diff --git a/Gemfile.lock b/Gemfile.lock index 1c3de1c96..7b502be86 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,13 @@ +GIT + remote: git://github.com/mjgiarlo/config.git + revision: d89ed7c5cb01c3b9968566156a0041c0d5f6997f + branch: parse_boolean_env_values + specs: + config (1.5.0) + activesupport (>= 3.0) + deep_merge (~> 1.1.1) + dry-validation (~> 0.10.4) + GIT remote: https://github.com/samvera/hyrax.git revision: 521cf92b7172cf84d2413cf5cc1afd94be1f634d @@ -209,9 +219,6 @@ GEM concurrent-ruby (1.0.5) concurrent-ruby-ext (1.0.5) concurrent-ruby (= 1.0.5) - config (1.4.0) - activesupport (>= 3.0) - deep_merge (~> 1.1.1) connection_pool (2.2.1) coveralls (0.8.21) json (>= 1.8, < 3) @@ -271,13 +278,13 @@ GEM dry-equalizer (~> 0.2) dry-logic (~> 0.4, >= 0.4.2) inflecto (~> 0.0.0, >= 0.0.2) - dry-validation (0.11.1) + dry-validation (0.10.7) concurrent-ruby (~> 1.0) dry-configurable (~> 0.1, >= 0.1.3) dry-core (~> 0.2, >= 0.2.1) dry-equalizer (~> 0.2) dry-logic (~> 0.4, >= 0.4.0) - dry-types (~> 0.12.0) + dry-types (~> 0.9, >= 0.9.0) easy_translate (0.5.0) json thread @@ -901,7 +908,7 @@ DEPENDENCIES capybara carrierwave-aws coffee-rails (~> 4.2) - config (~> 1.2, >= 1.2.1) + config! coveralls database_cleaner devise diff --git a/config/initializers/config_monkeypatch.rb b/config/initializers/config_monkeypatch.rb deleted file mode 100644 index 682af8ea6..000000000 --- a/config/initializers/config_monkeypatch.rb +++ /dev/null @@ -1,26 +0,0 @@ -# Monkey-patch config gem to support Boolean values in environment variable overrides -# This monkey-patch can be removed once this ticket is fixed & a new version of 'config' -# gem is released: https://github.com/railsconfig/config/issues/178 -Config::Options.class_eval do - protected - - # Try to convert string to a correct type - # monkey-patch this method to support boolean conversion: - # https://github.com/railsconfig/config/blob/master/lib/config/options.rb#L190 - def __value(v) - # rubocop:disable Style/RescueModifier - __boolean(v) rescue Integer(v) rescue Float(v) rescue v - # rubocop:enable Style/RescueModifier - end - - def __boolean(value) - case value - when 'false' - false - when 'true' - true - else - raise ArgumentError, "invalid value for Boolean(): #{v.inspect}" - end - end -end