dry-stack 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dry-stack/stack.rb +8 -9
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c88b6bc038fa30ed2b132c936cdae39d7cbc28a2fcfa0b303fc89fff05a53bb
|
4
|
+
data.tar.gz: fcce7e5376b5fa037ac96c9becf52f889115636e20ba9f42a1d3f929fdc5ffec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 255a433586527977da9d6ff9f7c579bcd646adc91c0616eb09345f55c8e715eb8d430939331013a651b369cf3c8eb8e56bd5552b7430916e31d3a0846d760e77
|
7
|
+
data.tar.gz: 9b749419d4c4ec2fe4b7ad330e7a3fddcd500757cd025ac6c90c48eafedf86708995c9f491e9e214c90feff71d48102d7e9f61820140d3980d38f25a24e5f399
|
data/lib/dry-stack/stack.rb
CHANGED
@@ -31,7 +31,7 @@ module Dry
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
def each_recursive(parent, each_
|
34
|
+
def each_recursive(parent, each_ = -> { _1.respond_to?(:each) ? _1.each : [] }, path = [], &blk)
|
35
35
|
each2_ = each_.is_a?(Array) ? ->(p) { (m = each_.find { p.respond_to? _1 }) ? p.send(m) : [] } : each_
|
36
36
|
(each2_[parent] || []).each do |(k,v)|
|
37
37
|
blk.call [path + [parent], k, v, path]
|
@@ -332,13 +332,11 @@ module Dry
|
|
332
332
|
(@after_blocks ||=[]) << block
|
333
333
|
end
|
334
334
|
|
335
|
-
|
336
|
-
# def ServicesEach(names, &)
|
337
|
-
# def ServicesEach(names, opts, &)
|
338
|
-
def ServicesEach(&block)
|
335
|
+
def ServicesEach(name = nil, opts = {}, &block)
|
339
336
|
After do
|
340
|
-
@services.
|
341
|
-
|
337
|
+
name ||= @services.keys
|
338
|
+
[name].flatten.each do |s_name|
|
339
|
+
Service s_name, opts, &block
|
342
340
|
end
|
343
341
|
end
|
344
342
|
end
|
@@ -348,12 +346,13 @@ module Dry
|
|
348
346
|
end
|
349
347
|
|
350
348
|
def Service(name, opts = {}, &)
|
349
|
+
opts = opts.dup
|
351
350
|
opts[:ports] = [opts[:ports]].flatten if opts.key? :ports
|
352
351
|
opts[:environment] = opts.delete(:env) if opts.key? :env
|
353
352
|
|
354
353
|
service = @services[name.to_sym] ||= {environment: {}, deploy: {labels: []}}
|
355
|
-
service.
|
356
|
-
ServiceFunction.new(service, &)
|
354
|
+
service.deep_merge! opts
|
355
|
+
ServiceFunction.new(service, &) if block_given?
|
357
356
|
end
|
358
357
|
|
359
358
|
def Description(string)
|
data/lib/version.rb
CHANGED