Class: Rundoc::CodeCommand::Pipe
- Inherits:
-
Rundoc::CodeCommand
- Object
- Rundoc::CodeCommand
- Rundoc::CodeCommand::Pipe
- Defined in:
- lib/rundoc/code_command/pipe.rb
Constant Summary
Constants inherited from Rundoc::CodeCommand
Instance Attribute Summary
Attributes inherited from Rundoc::CodeCommand
#command, #contents, #keyword, #original_args, #render_command, #render_result
Instance Method Summary collapse
-
#call(env = {}) ⇒ Object
before: “”, after: “”, commands: [[cmd, output], [cmd, output]].
-
#initialize(line) ⇒ Pipe
constructor
- :
- ls :
-
| tail -n 2 => “testntmp.filen”.
- #to_md(env = {}) ⇒ Object
Methods inherited from Rundoc::CodeCommand
Constructor Details
#initialize(line) ⇒ Pipe
- :
-
ls
- :
-
| tail -n 2
> “testntmp.filen”
7 8 9 |
# File 'lib/rundoc/code_command/pipe.rb', line 7 def initialize(line) @delegate = parse(line) end |
Instance Method Details
#call(env = {}) ⇒ Object
before: “”, after: “”, commands:
[[cmd, output], [cmd, output]]
15 16 17 18 19 20 21 |
# File 'lib/rundoc/code_command/pipe.rb', line 15 def call(env = {}) last_command = env[:commands].last puts "Piping: results of '#{last_command[:command]}' to '#{@delegate}'" @delegate.push(last_command[:output]) @delegate.call(env) end |
#to_md(env = {}) ⇒ Object
23 24 25 |
# File 'lib/rundoc/code_command/pipe.rb', line 23 def to_md(env = {}) "" end |