Class: Docdown::CodeCommands::Bash
Instance Attribute Summary
#command, #contents, #hidden, #keyword, #render_result
Instance Method Summary
collapse
#push, #render
Constructor Details
#initialize(command) ⇒ Bash
4
5
6
7
|
# File 'lib/docdown/code_commands/bash.rb', line 4
def initialize(command)
@command = command
@contents = ""
end
|
Instance Method Details
#call ⇒ Object
9
10
11
12
|
# File 'lib/docdown/code_commands/bash.rb', line 9
def call
puts "Executing: #{to_md.inspect}"
`#{@command} #{contents} 2>&1`
end
|
#to_md ⇒ Object
14
15
16
|
# File 'lib/docdown/code_commands/bash.rb', line 14
def to_md
"$ #{@command} #{contents}"
end
|