Sha256: 8c39b6ee8fd0b1827351328083491d8aa2827f8900435d4a1de8b8ae622b1a1c

Contents?: true

Size: 761 Bytes

Versions: 16

Compression:

Stored size: 761 Bytes

Contents

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
eco-helpers-0.8.3 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.8.2 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.8.1 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.7.2 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.7.1 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.6.17 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.6.16 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.6.15 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.6.13 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.6.12 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.6.11 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.6.9 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.6.8 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.6.7 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.6.6 lib/eco/common/meta_thor/command_group.rb
eco-helpers-0.6.5 lib/eco/common/meta_thor/command_group.rb