Skip to content

Commit

Permalink
Tidy up configuration merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Mar 24, 2024
1 parent d5ecee9 commit f0603eb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/falcon/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,9 @@ def supervisor(&block)
# @parameter parents [Array(Symbol)]
# @yields {...} The block that will generate the environment.
def merge(*parents, **initial, &block)
::Async::Service::Environment.build(**initial) do
parents.each do |parent|
Console.warn(self) {"Legacy mapping for #{parent.inspect} should be updated to use `include`!"}
include(Environment::LEGACY_ENVIRONMENTS[parent])
end

instance_exec(&block) if block
end
facets = parents.map{|parent| Environment::LEGACY_ENVIRONMENTS.fetch(parent)}

::Async::Service::Environment.build(*facets, **initial, &block)
end
end
end
Expand Down

0 comments on commit f0603eb

Please sign in to comment.