Class: BigFiles::ConfigFileParser

Inherits:
Object
  • Object
show all
Defined in:
lib/bigfiles/config_file_parser.rb

Overview

Load configuration from files

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_config_filename = '.bigfiles.yml', yaml_class: YAML, file_class: File) ⇒ ConfigFileParser

Returns a new instance of ConfigFileParser.



10
11
12
13
14
15
16
# File 'lib/bigfiles/config_file_parser.rb', line 10

def initialize(project_config_filename = '.bigfiles.yml',
               yaml_class: YAML,
               file_class: File)
  @project_config_filename = project_config_filename
  @yaml_class = yaml_class
  @file_class = file_class
end

Instance Attribute Details

#project_config_filenameObject (readonly)

Returns the value of attribute project_config_filename.



8
9
10
# File 'lib/bigfiles/config_file_parser.rb', line 8

def project_config_filename
  @project_config_filename
end

Instance Method Details

#parse_config_filesObject



18
19
20
21
22
# File 'lib/bigfiles/config_file_parser.rb', line 18

def parse_config_files
  config = {}
  project_config = parse_project_config
  config.merge(project_config)
end