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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5010fb1f68c965e46cfc971af6bc8cd51396b4ba0d536a941d05a8b1c57ad9e
4
- data.tar.gz: c1969aae21a128f7f6258bb40de6da55870d5cf2e111102d3dcde9783a07c372
3
+ metadata.gz: 6c88b6bc038fa30ed2b132c936cdae39d7cbc28a2fcfa0b303fc89fff05a53bb
4
+ data.tar.gz: fcce7e5376b5fa037ac96c9becf52f889115636e20ba9f42a1d3f929fdc5ffec
5
5
  SHA512:
6
- metadata.gz: f8b7e31c2c065ddb71b39aac76abaf0cd669c862eeebf5f9b2504ea76722e67a9d7bc0f2e98a68120c3ac6ef66d5c46d8d843a1eafa3f1d37d6a6f7809f4d213
7
- data.tar.gz: e4aa2c968ecec428dfe77fd5bb1813e2dd3330720da92b279b659062b141eb5ac41364f873f27f6e8591899429df7ef16f88483422b21a74f777eee6756ebf4b
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(&block)
335
+ def ServicesEach(name = nil, opts = {}, &block)
339
336
  After do
340
- @services.values.each do |svc|
341
- ServiceFunction.new(svc, &block) 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.9'
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.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artyom B