Sha256: 137e24ae4719bfc206ede67d38a951a1e06374a85d69ae0a88fa8adaa95d746c

Contents?: true

Size: 618 Bytes

Versions: 1

Compression:

Stored size: 618 Bytes

Contents

module Rocktumbler
  # The Group is a class responsible for outputting a gem group
  class Group
    attr_accessor :name

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rocktumbler-0.1.3 lib/rocktumbler/group.rb