Skip to content

Commit 52ae6c7

Browse files
ioquatixsamuel-williams-shopify
authored andcommitted
Support passing the loader as a block argument.
1 parent c7b8d5c commit 52ae6c7

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

lib/async/service/configuration.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ def self.build(root: Dir.pwd, &block)
2121
configuration = self.new
2222

2323
loader = Loader.new(configuration, root)
24-
loader.instance_eval(&block)
24+
25+
if block.arity == 0
26+
loader.instance_eval(&block)
27+
else
28+
yield loader
29+
end
2530

2631
return configuration
2732
end

releases.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Start health checker earlier in the process. Use `#healthy!` message instead of `#ready!`.
66
- Emit prepared and running log messages with durations (e.g. how long it took to transition to prepared and running states).
7+
- `Async::Service::Configuration.build{|loader|...}` can now take an argument for more flexible configuration construction.
78

89
## v0.17.0
910

0 commit comments

Comments
 (0)