Sha256: 3874d5502e322d1a742b5f2f2b8290980775b8d3a60930c492bfeea73d4f3e02

Contents?: true

Size: 789 Bytes

Versions: 35

Compression:

Stored size: 789 Bytes

Contents

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

module Fig; end
class Fig::Package; end

class Fig::Package::Configuration
  include Fig::Package::Statement

  attr_reader :name, :statements

  def initialize(name, statements)
    @name = name
    @statements = statements
  end

  def with_name(name)
    Configuration.new(name, statements)
  end

  def commands
    result = statements.select do
      |statement| statement.is_a?(Fig::Package::Command)
    end
    result
  end

  def walk_statements(&block)
    @statements.each do |statement|
      yield statement
      statement.walk_statements &block
    end
  end

  def unparse(indent)
    unparse_statements(indent, "config #{@name}", @statements, 'end')
  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
fig18-0.1.50-i386-mswin32 lib/fig/package/configuration.rb
fig18-0.1.50 lib/fig/package/configuration.rb
fig-0.1.50-java lib/fig/package/configuration.rb
fig-0.1.50 lib/fig/package/configuration.rb
fig18-0.1.50-i386-mingw32 lib/fig/package/configuration.rb
fig-0.1.49-java lib/fig/package/configuration.rb
fig-0.1.49 lib/fig/package/configuration.rb
fig18-0.1.49 lib/fig/package/configuration.rb
fig18-0.1.49-i386-mswin32 lib/fig/package/configuration.rb
fig18-0.1.49-i386-mingw32 lib/fig/package/configuration.rb
fig18-0.1.48 lib/fig/package/configuration.rb
fig18-0.1.48-i386-mswin32 lib/fig/package/configuration.rb
fig18-0.1.48-i386-mingw32 lib/fig/package/configuration.rb
fig-0.1.48 lib/fig/package/configuration.rb
fig-0.1.48-java lib/fig/package/configuration.rb
fig18-0.1.47 lib/fig/package/configuration.rb
fig18-0.1.47-i386-mswin32 lib/fig/package/configuration.rb
fig18-0.1.47-i386-mingw32 lib/fig/package/configuration.rb
fig-0.1.47 lib/fig/package/configuration.rb
fig-0.1.47-java lib/fig/package/configuration.rb