dry-stack 0.1.8 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2013846706c90a279211a43e86dd57cca783a058ef62f557b61b0860486d0da6
4
- data.tar.gz: bdb26f28293c601e5ea3be9190ab0b3834ff1c2800cf2b2033c3fc7b7d9c5f97
3
+ metadata.gz: 6c88b6bc038fa30ed2b132c936cdae39d7cbc28a2fcfa0b303fc89fff05a53bb
4
+ data.tar.gz: fcce7e5376b5fa037ac96c9becf52f889115636e20ba9f42a1d3f929fdc5ffec
5
5
  SHA512:
6
- metadata.gz: 7c7dd8efd6e55b5cebe69bc8fef7f1eed626441874b0e8e601e814f590c9507eeee7ccaa6337760f3ab51d318d002104f44fc43aded90cf4b8f182129b4795d0
7
- data.tar.gz: 04fd919fc49b22dca5c014b123ffcab12734c74db06daf4d796cfee7e249e5080039b9e7ce985984deca640685233002ae88886157fad798469b0c15759f237e
6
+ metadata.gz: 255a433586527977da9d6ff9f7c579bcd646adc91c0616eb09345f55c8e715eb8d430939331013a651b369cf3c8eb8e56bd5552b7430916e31d3a0846d760e77
7
+ data.tar.gz: 9b749419d4c4ec2fe4b7ad330e7a3fddcd500757cd025ac6c90c48eafedf86708995c9f491e9e214c90feff71d48102d7e9f61820140d3980d38f25a24e5f399
@@ -31,7 +31,7 @@ module Dry
31
31
  end
32
32
  end
33
33
 
34
- def each_recursive(parent, each_ =-> { _1.respond_to?(:each) ? _1.each : [] }, path = [], &blk)
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
- # TODO: latter
336
- # def ServicesEach(names, &)
337
- # def ServicesEach(names, opts, &)
338
- def ServicesEach(&)
335
+ def ServicesEach(name = nil, opts = {}, &block)
339
336
  After do
340
- @services.values.each do |svc|
341
- ServiceFunction.new(svc,&) if block_given?
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.merge! opts
356
- ServiceFunction.new(service, &) if block_given?
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
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  class Stack
3
- VERSION = '0.1.8'
3
+ VERSION = '0.1.10'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artyom B