Module: EacRubyUtils::Envs::Command::Concat

Defined in:
lib/eac_ruby_utils/envs/command/concat.rb

Constant Summary collapse

AND_OPERATOR =
'&&'
BEFORE_OPERATOR =
';'
OR_OPERATOR =
'||'
PIPE_OPERATOR =
'|'

Instance Method Summary collapse

Instance Method Details

#and(other_command) ⇒ EacRubyUtils::Envs::Command



21
22
23
# File 'lib/eac_ruby_utils/envs/command/concat.rb', line 21

def and(other_command)
  concat(AND_OPERATOR, other_command)
end

#before(other_command) ⇒ EacRubyUtils::Envs::Command



26
27
28
# File 'lib/eac_ruby_utils/envs/command/concat.rb', line 26

def before(other_command)
  concat(BEFORE_OPERATOR, other_command)
end

#concat(operator, other_command) ⇒ Object



14
15
16
17
18
# File 'lib/eac_ruby_utils/envs/command/concat.rb', line 14

def concat(operator, other_command)
  duplicate_by_extra_options(concat: ::EacRubyUtils::Struct.new(
    operator: operator, command: other_command
  ))
end

#or(other_command) ⇒ Object



30
31
32
# File 'lib/eac_ruby_utils/envs/command/concat.rb', line 30

def or(other_command)
  concat(OR_OPERATOR, other_command)
end

#pipe(other_command) ⇒ Object



34
35
36
# File 'lib/eac_ruby_utils/envs/command/concat.rb', line 34

def pipe(other_command)
  concat(PIPE_OPERATOR, other_command)
end