Class: DDSL::Command::Base
- Inherits:
-
Object
- Object
- DDSL::Command::Base
- Includes:
- DSL
- Defined in:
- lib/ddsl/command/base.rb
Direct Known Subclasses
Docker::Build, Docker::Push, Docker::Run, DockerCompose::Build, DockerCompose::Run
Instance Attribute Summary collapse
-
#shell ⇒ Object
readonly
Returns the value of attribute shell.
Instance Method Summary collapse
- #exec_after_block(spec) ⇒ Object
-
#initialize(shell = DDSL::Shell.new) ⇒ Base
constructor
A new instance of Base.
- #run(spec) ⇒ Object
Methods included from DSL
Constructor Details
#initialize(shell = DDSL::Shell.new) ⇒ Base
12 13 14 |
# File 'lib/ddsl/command/base.rb', line 12 def initialize(shell = DDSL::Shell.new) @shell = shell end |
Instance Attribute Details
#shell ⇒ Object (readonly)
Returns the value of attribute shell.
10 11 12 |
# File 'lib/ddsl/command/base.rb', line 10 def shell @shell end |
Instance Method Details
#exec_after_block(spec) ⇒ Object
30 31 32 |
# File 'lib/ddsl/command/base.rb', line 30 def exec_after_block(spec) instance_exec(spec, &after_block) unless after_block.nil? end |
#run(spec) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ddsl/command/base.rb', line 16 def run(spec) argv = [ executable, .call(spec), command, .call(spec), arguments.call(spec).values ].flatten @shell.call!(argv) exec_after_block(spec) end |