Class: Mattock::ShellEscaped
Instance Attribute Summary
Attributes inherited from CommandLine
#env, #executable, #options, #output_stream, #redirections
Instance Method Summary
collapse
Methods inherited from CommandLine
#background, #collect_result, #complete, #copy_stream_to, define_chain_op, define_op, emit_recording, #execute, execute, #kill_process, #must_succeed!, #options_composition, #original_execute, #redirect_from, #redirect_stderr, #redirect_stdin, #redirect_stdout, #redirect_to, #replace_us, #report, #run, #set_env, #spawn_process, #spin_off, #string_format, #succeeds?, #verbose
Constructor Details
Returns a new instance of ShellEscaped.
186
187
188
|
# File 'lib/mattock/command-line.rb', line 186
def initialize(cmd)
@escaped = cmd
end
|
Instance Method Details
#command ⇒ Object
190
191
192
|
# File 'lib/mattock/command-line.rb', line 190
def command
"'" + @escaped.string_format.gsub(/'/,"\'") + "'"
end
|
#command_environment ⇒ Object
194
195
196
|
# File 'lib/mattock/command-line.rb', line 194
def command_environment
{}
end
|
#name ⇒ Object
198
199
200
|
# File 'lib/mattock/command-line.rb', line 198
def name
@name || @escaped.name
end
|
#to_s ⇒ Object
202
203
204
|
# File 'lib/mattock/command-line.rb', line 202
def to_s
command
end
|