Class: Fig::Command::PackageApplier

Inherits:
Object
  • Object
show all
Defined in:
lib/fig/command/package_applier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_package, environment, options, descriptor, base_config, package_source_description) ⇒ PackageApplier

Returns a new instance of PackageApplier.


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/fig/command/package_applier.rb', line 12

def initialize(
  base_package,
  environment,
  options,
  descriptor,
  base_config,
  package_source_description
)
  @base_package                 = base_package
  @environment                  = environment
  @options                      = options
  @descriptor                   = descriptor
  @base_config                  = base_config
  @package_source_description   = package_source_description
end

Instance Attribute Details

#synthetic_package_for_command_lineObject (readonly)

Returns the value of attribute synthetic_package_for_command_line


10
11
12
# File 'lib/fig/command/package_applier.rb', line 10

def synthetic_package_for_command_line
  @synthetic_package_for_command_line
end

Instance Method Details

#activate_retrievesObject


28
29
30
31
32
33
34
# File 'lib/fig/command/package_applier.rb', line 28

def activate_retrieves()
  @base_package.retrieves.each do |statement|
    @environment.add_retrieve(statement)
  end

  return
end

#apply_config_to_environment(ignore_base_config) ⇒ Object


42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fig/command/package_applier.rb', line 42

def apply_config_to_environment(ignore_base_config)
  begin
    @synthetic_package_for_command_line =
      synthesize_package_for_command_line_options(ignore_base_config)
    @environment.apply_config(
      @synthetic_package_for_command_line, Fig::Package::DEFAULT_CONFIG, nil
    )
  rescue Fig::NoSuchPackageConfigError => exception
    make_no_such_package_exception_descriptive(exception)
  end

  return
end

#register_package_with_environmentObject


36
37
38
39
40
# File 'lib/fig/command/package_applier.rb', line 36

def register_package_with_environment()
  @environment.register_package(@base_package)

  return
end