Sha256: 9d94eab990a7e250ea3f9825536ae0ef20f83035108c8a5c0816155b17cfe52b
Contents?: true
Size: 1.05 KB
Versions: 16
Compression:
Stored size: 1.05 KB
Contents
module Eco module Common class MetaThor class CommandUnit class << self end attr_reader :group, :index attr_reader :pipe attr_reader :args, :source_args attr_accessor :output def initialize(args:, group:, index:) @source_args = args.dup || [] @args = @source_args @args = @args.slice(1..-1) if Pipe.piped?(@source_args) @pipe = Pipe.new(command: self) if Pipe.piped?(@source_args) @group = group @index = index end def piped? !!@pipe end def input pipe&.input end def args arguments = @args.dup arguments = yield(arguments) if block_given? arguments end def piped_args args.tap do |arguments| arguments = yield(arguments) if block_given? arguments.push(pipe.input.as_input_option) if piped? end end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems