Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
artyomb committed Jul 28, 2024
1 parent dcf1c66 commit bb387f6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
dry-stack (0.1.0)
dry-stack (0.1.1)

GEM
remote: https://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This gem allows ...
cat simple_stack.drs | dry-stack -e to_compose | docker stack deploy -c - simple_stack
$ dry-stack
Version: 0.1.0
Version: 0.1.1
Usage:
dry-stack -s stackfile [options] COMMAND
cat stackfile | dry-stack COMMAND
Expand Down
10 changes: 5 additions & 5 deletions lib/dry-stack/stack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def ports(ports)= ((@service[:ports] ||= []) << ports).flatten!
def command(cmd)= @service[:command] = cmd
def entrypoint(cmd)= @service[:entrypoint] = cmd
def deploy_label(str)= @service[:deploy][:labels] << str
def config(name = nil, opts)= (@service[:configs] ||= []) << {source: name.to_s }.merge(opts)
def config(name = nil, opts)= (@service[:configs] ||= []) << {source: name.to_s}.merge(opts)
def logging(opts) = (@service[:logging] ||= {}).merge! opts
def user(user) = @service[:user] = user # "${UID}:${GID}", "www-data:www-data"
def network(names) = (@service[:networks] ||= []) << names
Expand Down Expand Up @@ -122,7 +122,7 @@ def nginx_host2regexp(str)

def apply_configuration(configuration)
raise "Configuration not found: #{configuration}" unless @configurations[configuration.to_sym]
@configurations[configuration.to_sym][:block_function].call @configurations[configuration.to_sym]
@configurations[configuration.to_sym][:block_function].call
end

def to_compose(opts = @options)
Expand Down Expand Up @@ -383,10 +383,10 @@ def Volume(name, opts = {})
end

def Configuration(name, opts = {}, &)
configuration = @configurations[name.to_sym] ||= { }
configuration = @configurations[name.to_sym] ||= {}
configuration.merge! opts
configuration.merge! block_function: ->(*args){
self.instance_exec(&) if block_given?
configuration.merge! block_function: -> {
instance_exec(&) if block_given? # https://rubyreferences.github.io/rubychanges/3.3.html#anonymous-parameters-forwarding-inside-blocks-are-disallowed
}
end

Expand Down
2 changes: 1 addition & 1 deletion lib/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Dry
class Stack
VERSION = '0.1.0'
VERSION = '0.1.1'
end
end

0 comments on commit bb387f6

Please sign in to comment.