Module: ShellCommands::Examples

Included in:
ShellCommands
Defined in:
app/models/shell_command.rb

Constant Summary collapse

Hello_world =
ShellCommands.new('echo "Hello World"')
Example_output =
"1 2;3 4\n"
COMMAND_STRING =
'echo "1 2;3 4"'
EXAMPLE =
ShellCommands.new(COMMAND_STRING)
Guaranteed_existing_directory =
File.expand_path(File.dirname($0))
Cd_command_array =
['cd', Guaranteed_existing_directory]
Cd_command_hash =
{:command => 'cd', :in => Guaranteed_existing_directory}
Guaranteed_existing_basename =
File.basename($0)
Redirect_command =
['ls', Guaranteed_existing_basename, '>', 'blank in filename.shell_command']
Redirect_command_string =
'ls '+ Shellwords.escape(Guaranteed_existing_basename)+' > '+Shellwords.escape('blank in filename.shell_command')
Relative_command =
['ls', Guaranteed_existing_basename]