Class: Fig::FigRC

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

Overview

Parse multiple figrc files and assemble them into a single ApplicationConfiguration object.

Constant Summary collapse

REPOSITORY_CONFIGURATION =
"#{Fig::Repository::METADATA_SUBDIRECTORY}/figrc"

Class Method Summary collapse

Class Method Details

.find(override_path, specified_repository_url, operating_system, fig_home, disable_figrc = false, disable_remote_figrc = false) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/fig/figrc.rb', line 19

def self.find(
  override_path,
  specified_repository_url,
  operating_system,
  fig_home,
  disable_figrc = false,
  disable_remote_figrc = false
)
  configuration = Fig::ApplicationConfiguration.new()

  handle_override_configuration(configuration, override_path)
  handle_figrc(configuration) if not disable_figrc

  repository_url =
    derive_repository_url(specified_repository_url, configuration)

  configuration.base_whitelisted_url = repository_url
  configuration.remote_repository_url = repository_url

  handle_repository_configuration(
    configuration, repository_url, operating_system, fig_home
  ) if not disable_remote_figrc

  return configuration
end