Class: EacRubyUtils::Envs::CompositeCommand
- Includes:
- BaseCommand
- Defined in:
- lib/eac_ruby_utils/envs/composite_command.rb
Instance Method Summary collapse
- #bash_command ⇒ String
- #command_line_without_env(_options = {}) ⇒ String
- #env ⇒ EacRubyUtils::Envs::BaseEnv
- #left_command_line ⇒ Object
- #right_command_line ⇒ Object
Methods included from BaseCommand
Instance Method Details
#bash_command ⇒ String
27 28 29 30 |
# File 'lib/eac_ruby_utils/envs/composite_command.rb', line 27 def bash_command ['set', '-euo', 'pipefail', OPERATOR_BEFORE, left_command_line, operator, right_command_line].join(' ') end |
#command_line_without_env(_options = {}) ⇒ String
22 23 24 |
# File 'lib/eac_ruby_utils/envs/composite_command.rb', line 22 def command_line_without_env( = {}) ::Shellwords.join(['bash', '-c', bash_command]) end |
#env ⇒ EacRubyUtils::Envs::BaseEnv
19 |
# File 'lib/eac_ruby_utils/envs/composite_command.rb', line 19 delegate :env, to: :left_command |
#left_command_line ⇒ Object
32 33 34 |
# File 'lib/eac_ruby_utils/envs/composite_command.rb', line 32 def left_command_line left_command.command_line_without_env end |
#right_command_line ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/eac_ruby_utils/envs/composite_command.rb', line 36 def right_command_line if right_command.env == left_command.env right_command.command_line_without_env else right_command.command end end |