Class: EacRubyUtils::Envs::BaseCommand::AppendCommandOptions
- Defined in:
- lib/eac_ruby_utils/envs/base_command/append_command_options.rb
Instance Method Summary collapse
- #input ⇒ EacRubyUtils::Envs::Command?
- #input_file ⇒ Pathname?
- #output_file ⇒ Pathname?
- #result ⇒ Object
Instance Method Details
#input ⇒ EacRubyUtils::Envs::Command?
22 23 24 |
# File 'lib/eac_ruby_utils/envs/base_command/append_command_options.rb', line 22 def input [:input] end |
#input_file ⇒ Pathname?
27 28 29 |
# File 'lib/eac_ruby_utils/envs/base_command/append_command_options.rb', line 27 def input_file [:input_file].if_present(&:to_pathname) end |
#output_file ⇒ Pathname?
32 33 34 |
# File 'lib/eac_ruby_utils/envs/base_command/append_command_options.rb', line 32 def output_file [:output_file].if_present(&:to_pathname) end |
#result ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/eac_ruby_utils/envs/base_command/append_command_options.rb', line 13 def result r = command_line r = "#{input.command} | #{r}" if input r = "cat #{Shellwords.escape(input_file)} | #{r}" if input_file r += " > #{Shellwords.escape(output_file)}" if output_file r end |