lib/formalizer/formalizer.rb
# Loads config from YAML file
# * +config_file+ - path to the config file, absolute or relative to app's 'config' path
# Raises an error if YAML file is ill-formatted
# Puts a warning if not YAML file not found
Loads config from YAML file
+config_file+ - path to the config file, absolute or relative to app's 'config' path
Raises an error if YAML file is ill-formatted
Puts a warning if not YAML file not found
Loads config from YAML file + config_file + - path to the config file absolute or relative to app ' s ' config ' path Raises an error if YAML file is ill - formatted Puts a warning if not YAML file not found
def load_config config_file
    @config = nil
    begin
      config_file_content = Utils::find_file(config_file) 
      @config ||= YAML.load(config_file_content)
    rescue FileNotFound
      puts "YAML Not found in #{File.expand_path(config_file)}"
    rescue Psych::SyntaxError
      raise "YAML Syntax Error in #{file_path}"
    end
    @config ||= EMPTY_CONFIG
    validate_config
    @config.deep_symbolize_keys!
  end
def load_config config_file @config = nil begin config_file_content = Utils :: find_file ( config_file ) @config ||= YAML . load ( config_file_content ) rescue FileNotFound puts "YAML Not found in #{File.expand_path(config_file)}" rescue Psych :: SyntaxError raise "YAML Syntax Error in #{file_path}" end @config ||= EMPTY_CONFIG validate_config @config . deep_symbolize_keys! end
Loads config from YAML file
 +config_file+ - path to the config file, absolute or relative to app's 'config' path
Raises an error if YAML file is ill-formatted
Puts a warning if not YAML file not found
Loads config from YAML file + config_file + - path to the config file absolute or relative to app ' s ' config ' path Raises an error if YAML file is ill - formatted Puts a warning if not YAML file not found
# searching in paths # will raise an exception if not found # ok, no config... not a disaster # config found but ill-formatted YAML # Fallback to an empty config # YAML is translated to quoted keys, FormField expects symbols:
config_file
<not_specific>