Method: Mysql2Model::Client.load_repos

Defined in:
lib/mysql2_model/client.rb

.load_repos(force = false) ⇒ Object

loads the repositories with the YAML object pointed to by Mysql2Model::Config.repository_path, subsequent calls are ignored unless forced.

Parameters:

  • force (boolean) (defaults to: false)

    Use force = true to reload the repositories and overwrite the existing Hash.



35
36
37
38
39
40
41
42
43
# File 'lib/mysql2_model/client.rb', line 35

def load_repos(force=false)
  unless force
    return unless @repositories.blank?
  end
  repos = YAML.load(File.new(Mysql2Model::Config.repository_path, 'r'))
  repos[:repositories].each do |repo, config|
    self[repo] = config 
  end
end