Method: Tkri::Settings.load

Defined in:
lib/tkri.rb

.loadObject

Load the settings from the ‘rc’ file. We merge them into the existing settings.



165
166
167
168
169
170
171
172
173
174
175
# File 'lib/tkri.rb', line 165

def self.load
  if File.exist? Tkri.get_rc_file_path
    require 'yaml'
    settings = YAML.load_file(Tkri.get_rc_file_path)
    if settings.instance_of? Hash
      COMMAND.merge!(settings['command']) if settings['command']
      VISUALS.merge!(settings['visuals']) if settings['visuals']
      BINDINGS.merge!(settings['bindings']) if settings['bindings']
    end
  end
end