Sha256: 99b1bf47867954bd037e1a52e2a0552f622bdded8a9f500e2572a4bf4ea1363e

Contents?: true

Size: 1.01 KB

Versions: 74

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/struct'

module EacRubyUtils
  module Envs
    module BaseCommand
      module Concat
        AND_OPERATOR = '&&'
        BEFORE_OPERATOR = ';'
        OR_OPERATOR = '||'
        PIPE_OPERATOR = '|'

        # @param operator [Symbol]
        # @return [EacRubyUtils::Envs::CompositeCommand]
        def concat(operator, other_command)
          require 'eac_ruby_utils/envs/composite_command'
          ::EacRubyUtils::Envs::CompositeCommand.new(operator, self, other_command)
        end

        # @return [EacRubyUtils::Envs::Command]
        def and(other_command)
          concat(AND_OPERATOR, other_command)
        end

        # @return [EacRubyUtils::Envs::Command]
        def before(other_command)
          concat(BEFORE_OPERATOR, other_command)
        end

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

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

Version data entries

74 entries across 74 versions & 2 rubygems

Version Path
eac_ruby_utils-0.124.0 lib/eac_ruby_utils/envs/base_command/concat.rb
eac_tools-0.97.2 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb
eac_ruby_utils-0.123.0 lib/eac_ruby_utils/envs/base_command/concat.rb
eac_ruby_utils-0.121.0 lib/eac_ruby_utils/envs/base_command/concat.rb
eac_ruby_utils-0.120.0 lib/eac_ruby_utils/envs/base_command/concat.rb
eac_tools-0.76.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb
eac_tools-0.76.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb
eac_tools-0.75.2 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb
eac_ruby_utils-0.119.2 lib/eac_ruby_utils/envs/base_command/concat.rb
eac_tools-0.75.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb
eac_tools-0.75.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb
eac_ruby_utils-0.119.1 lib/eac_ruby_utils/envs/base_command/concat.rb
eac_tools-0.74.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb
eac_tools-0.74.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb
eac_tools-0.73.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb
eac_ruby_utils-0.119.0 lib/eac_ruby_utils/envs/base_command/concat.rb
eac_tools-0.72.0 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb
eac_ruby_utils-0.118.1 lib/eac_ruby_utils/envs/base_command/concat.rb
eac_ruby_utils-0.118.0 lib/eac_ruby_utils/envs/base_command/concat.rb
eac_tools-0.70.1 sub/eac_ruby_utils/lib/eac_ruby_utils/envs/base_command/concat.rb