Skip to content
Open
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
4 changes: 2 additions & 2 deletions envied.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions lib/envied.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/envied/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/envied_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down