diff --git a/envied.gemspec b/envied.gemspec index ae230f8..1b9e144 100644 --- a/envied.gemspec +++ b/envied.gemspec @@ -29,10 +29,10 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ">= 2.4" - spec.add_dependency "thor", "~> 0.20" + spec.add_dependency "thor", "~> 1.2.1" spec.add_development_dependency "bundler", "~> 2.0" spec.add_development_dependency "pry", "~> 0.12" - spec.add_development_dependency "rake", "~> 12.0" + spec.add_development_dependency "rake", "~> 13.0.6" spec.add_development_dependency "rspec", "~> 3.0" end diff --git a/lib/envied.rb b/lib/envied.rb index e557b45..310b4ec 100644 --- a/lib/envied.rb +++ b/lib/envied.rb @@ -15,13 +15,13 @@ class << self def self.require(*args, **options) requested_groups = (args && !args.empty?) ? args : ENV['ENVIED_GROUPS'] - env!(requested_groups, options) + env!(requested_groups, **options) error_on_duplicate_variables!(options) - error_on_missing_variables!(options) - error_on_uncoercible_variables!(options) + error_on_missing_variables!(**options) + error_on_uncoercible_variables!(**options) intercept_env_vars! - ensure_spring_after_fork_require(args, options) + ensure_spring_after_fork_require(args, **options) end def self.env!(requested_groups, **options) @@ -63,7 +63,7 @@ def self.error_on_uncoercible_variables!(**options) def self.required_groups(*groups) splitter = ->(group){ group.is_a?(String) ? group.split(/ *, */) : group } - result = groups.compact.map(&splitter).flatten + result = groups.compact.map(&splitter).flatten.select {|r| r.class != Hash } result.any? ? result.map(&:to_sym) : [:default] end diff --git a/lib/envied/configuration.rb b/lib/envied/configuration.rb index 64b643c..51fbdd8 100644 --- a/lib/envied/configuration.rb +++ b/lib/envied/configuration.rb @@ -22,7 +22,7 @@ def enable_defaults!(*args) def self.load(**options) envfile = File.expand_path('Envfile') - new(options).tap do |v| + new(**options).tap do |v| v.instance_eval(File.read(envfile), envfile) end end @@ -32,7 +32,7 @@ def variable(name, type = :string, **options) raise ArgumentError, "#{type.inspect} is not a supported type. Should be one of #{coercer.supported_types}" end options[:group] = current_group if current_group - variables << ENVied::Variable.new(name, type, options) + variables << ENVied::Variable.new(name, type, **options) end def group(*names, &block) diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index 04be813..828b75c 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -3,7 +3,7 @@ it { is_expected.to respond_to :group } def with_envfile(**options, &block) - @config = ENVied::Configuration.new(options, &block) + @config = ENVied::Configuration.new(**options, &block) end attr_reader :config diff --git a/spec/envied_spec.rb b/spec/envied_spec.rb index 9108120..15e801d 100644 --- a/spec/envied_spec.rb +++ b/spec/envied_spec.rb @@ -22,7 +22,7 @@ def set_ENV(env = {}) end def configure(**options, &block) - @config = ENVied::Configuration.new(options, &block) + @config = ENVied::Configuration.new(**options, &block) end def configured_with(**hash)