module Eco module Common class MetaThor class CommandGroup attr_reader :units def initialize(args) args = (args && [args].flatten) || [] #pp "CommandGroup split args: #{Pipe.split(args)}" @units = Pipe.split(args).each_with_index.map do |arguments, i| CommandUnit.new(args: arguments, group: self, index: i) end @units = units end def print @units.map do |command| pp command.args end end def [](value) @units[value] end def map @units.map do |unit| yield(unit) end end end end end end