Method: Pipeline.load_options

Defined in:
lib/pipeline.rb

.load_options(custom_location, quiet) ⇒ Object

Load options from YAML file



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/pipeline.rb', line 73

def self.load_options custom_location, quiet
  #Load configuration file
  if config = config_file(custom_location)
    options = YAML.load_file config

    if options
      options.each { |k, v| options[k] = Set.new v if v.is_a? Array }

      # notify if options[:quiet] and quiet is nil||false
      notify "[Notice] Using configuration in #{config}" unless (options[:quiet] || quiet)
      options
    else
      notify "[Notice] Empty configuration file: #{config}" unless quiet
      {}
    end
  else
    {}
  end
end