Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to config gem 2.0.0 #19418

Merged
merged 1 commit into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ gem "bcrypt", "~> 3.1.10", :require => false
gem "bundler", ">=1.15", :require => false
gem "byebug", :require => false
gem "color", "~>1.8"
gem "config", "~>1.6.0", :require => false
gem "config", "~>2.0", :require => false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can lock this down to ~>2.0.0 if desired. It's been pretty stable, so 🤷‍♂

gem "dalli", "=2.7.6", :require => false
gem "default_value_for", "~>3.3"
gem "docker-api", "~>1.33.6", :require => false
Expand Down
6 changes: 4 additions & 2 deletions lib/vmdb/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def initialize(errors)

def self.init
::Config.overwrite_arrays = true
::Config.merge_nil_values = false
reset_settings_constant(for_resource(:my_server))
on_reload
end
Expand Down Expand Up @@ -182,8 +183,9 @@ def self.local_sources
# sources and doesn't allow you insert new sources into the middle of the
# stack.
def self.reset_settings_constant(settings)
Kernel.send(:remove_const, ::Config.const_name) if Kernel.const_defined?(::Config.const_name)
Kernel.const_set(::Config.const_name, settings)
name = ::Config.const_name
Object.send(:remove_const, name) if Object.const_defined?(name)
Object.const_set(name, settings)
end
private_class_method :reset_settings_constant

Expand Down