Sha256: 5ce681cd61e0540c9c65773d7dc5988bac43b94639a462884da7d37a803997d4

Contents?: true

Size: 495 Bytes

Versions: 3

Compression:

Stored size: 495 Bytes

Contents

module Rocktumbler
  class Group

    attr_accessor :name

    def initialize(name,gem_dependencies)
      @name = name
      @gems = gem_dependencies.map{|g| Rocktumbler::Gem.new(g)}
    end

    def print
      str = ''
      prepend_spacing = (@name == :default) ? '' : '  '
      str += "\n\ngroup #{@name.to_s.gsub(/[\[\]]/,'')} do\n" if @name != :default
      str += @gems.map{|g|g.print(prepend_spacing)}.join
      str += "end\n" if @name != :default
      return str
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rocktumbler-0.1.2 lib/rocktumbler/group.rb
rocktumbler-0.1.1 lib/rocktumbler/group.rb
rocktumbler-0.1.0 lib/rocktumbler/group.rb