Method: Roby::Application#load_config_yaml

Defined in:
lib/roby/app.rb

#load_config_yamlObject



2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
# File 'lib/roby/app.rb', line 2096

def load_config_yaml
    file = find_file("config", "app.yml", order: :specific_first)
    return unless file

    Application.info "loading config file #{file}"
    options = YAML.safe_load(File.read(file)) || {}

    @robots.load_config_yaml(options["robots"] || {})

    if robot_name && (robot_config = options.delete("robots"))
        options = options.recursive_merge(robot_config[robot_name] || {})
    end
    options = options.transform_values do |val|
        val || {}
    end
    options = @options.recursive_merge(options)
    apply_config(options)
    @options = options
end