Sha256: 6f7f50336e3b06fb1c1d90c1fe583ca9ff833eac11b93717fe88812ec89776d6

Contents?: true

Size: 1.36 KB

Versions: 5

Compression:

Stored size: 1.36 KB

Contents

require 'fig/command/action'
require 'fig/command/action/role/has_no_sub_action'
require 'fig/package_definition_text_assembler'

module  Fig; end
class   Fig::Command; end
module  Fig::Command::Action; end

class Fig::Command::Action::DumpPackageDefinitionParsed
  include Fig::Command::Action
  include Fig::Command::Action::Role::HasNoSubAction

  def options()
    return %w<--dump-package-definition-parsed>
  end

  def descriptor_requirement()
    return nil
  end

  def modifies_repository?()
    return false
  end

  def load_base_package?()
    return true
  end

  def register_base_package?()
    return false
  end

  def apply_config?()
    return false
  end

  def execute()
    if @execution_context.synthetic_package_for_command_line
      # Purposely syntactically incorrect so that nothing attempts to round
      # trip this.
      puts "---- synthetic package for command-line ----\n"
      dump_package @execution_context.synthetic_package_for_command_line

      puts "\n---- base package ----\n"
    end

    dump_package @execution_context.base_package

    return EXIT_SUCCESS
  end

  private

  def dump_package(package)
    text_assembler = Fig::PackageDefinitionTextAssembler.new :emit_as_input
    text_assembler.add_output package.statements

    unparsed, explanations = text_assembler.assemble_package_definition
    print unparsed

    return
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fig-1.1.0 lib/fig/command/action/dump_package_definition_parsed.rb
fig-1.0.0 lib/fig/command/action/dump_package_definition_parsed.rb
fig-0.2.5 lib/fig/command/action/dump_package_definition_parsed.rb
fig-0.2.3 lib/fig/command/action/dump_package_definition_parsed.rb
fig-0.2.1 lib/fig/command/action/dump_package_definition_parsed.rb