Class: Standard::BuildsConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/standard/builds_config.rb

Instance Method Summary collapse

Constructor Details

#initializeBuildsConfig

Returns a new instance of BuildsConfig.


9
10
11
12
13
14
# File 'lib/standard/builds_config.rb', line 9

def initialize
  @parses_cli_option = ParsesCliOption.new
  @loads_yaml_config = LoadsYamlConfig.new
  @merges_settings = MergesSettings.new
  @creates_config_store = CreatesConfigStore.new
end

Instance Method Details

#call(argv, search_path = Dir.pwd) ⇒ Object


16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/standard/builds_config.rb', line 16

def call(argv, search_path = Dir.pwd)
  standard_yaml_path = determine_yaml_file(argv, search_path, "--config", ".standard.yml")
  todo_yaml_path = determine_yaml_file(argv, search_path, "--todo", ".standard_todo.yml")
  standard_config = @loads_yaml_config.call(standard_yaml_path, todo_yaml_path)

  settings = @merges_settings.call(argv, standard_config)
  Config.new(
    settings.runner,
    settings.paths,
    settings.options,
    @creates_config_store.call(standard_config)
  )
end