Sha256: c33f6fa4db3ad15d06707003516e35ab026411f57264f83132b0e6b4a840a1eb

Contents?: true

Size: 942 Bytes

Versions: 5

Compression:

Stored size: 942 Bytes

Contents

require 'fig/logging'
require 'fig/packageerror'
require 'fig/package/statement'

module Fig; end
class Fig::Package; end

# Dual role: "include :configname" incorporates one configuration into another;
# "include package[/version]" declares a dependency upon another package.
class Fig::Package::Include
  include Fig::Package::Statement

  attr_reader :package_name, :config_name, :version_name, :overrides

  def initialize(package_name, config_name, version_name, overrides)
    @package_name = package_name
    @config_name = config_name
    @version_name = version_name
    @overrides = overrides
  end

  def unparse(indent)
    descriptor = ''
    descriptor += @package_name if @package_name
    descriptor += "/#{@version_name}" if @version_name
    descriptor += ":#{@config_name}" if @config_name
    @overrides.each do |override|
      descriptor += override.unparse
    end
    return "#{indent}include #{descriptor}"
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
fig18-0.1.51-i386-mswin32 lib/fig/package/include.rb
fig18-0.1.51-i386-mingw32 lib/fig/package/include.rb
fig18-0.1.51 lib/fig/package/include.rb
fig-0.1.51-java lib/fig/package/include.rb
fig-0.1.51 lib/fig/package/include.rb