Class: Mattock::CommandChain
- Inherits:
-
CommandLine
- Object
- CommandLine
- Mattock::CommandChain
- Defined in:
- lib/mattock/command-line.rb
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) commands
readonly
Returns the value of attribute commands.
Attributes inherited from CommandLine
Instance Method Summary (collapse)
- - (Object) add(cmd) {|cmd| ... }
-
- (CommandChain) initialize {|_self| ... }
constructor
A new instance of CommandChain.
- - (Object) name
Methods inherited from CommandLine
#command, #copy_stream_to, emit_recording, execute, #must_succeed!, original_execute, #redirect_from, #redirect_stderr, #redirect_stdin, #redirect_stdout, #redirect_to, #run, #succeeds?, #verbose
Constructor Details
- (CommandChain) initialize {|_self| ... }
A new instance of CommandChain
128 129 130 131 |
# File 'lib/mattock/command-line.rb', line 128 def initialize @commands = [] yield self if block_given? end |
Instance Attribute Details
- (Object) commands (readonly)
Returns the value of attribute commands
133 134 135 |
# File 'lib/mattock/command-line.rb', line 133 def commands @commands end |
Instance Method Details
- (Object) add(cmd) {|cmd| ... }
135 136 137 138 |
# File 'lib/mattock/command-line.rb', line 135 def add(cmd) yield cmd if block_given? @commands << cmd end |
- (Object) name
140 141 142 |
# File 'lib/mattock/command-line.rb', line 140 def name @name || @commands.last.name end |