Module: MGit::Configuration

Defined in:
lib/mgit/configuration.rb

Constant Summary collapse

KEYS =
{
  :threads => {
    :default => true,
    :description => 'set to true if you want the fetch command to be threaded'
  },

  :plugindir => {
    :default => File.join(AppData::AppDataVersion.latest.send(:config_dir), 'plugins'),
    :description => 'directory from where plugin commands are loaded'
  }
}

Class Method Summary collapse

Class Method Details

.set(key, value) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/mgit/configuration.rb', line 29

def self.set(key, value)
  case key
  when 'threads'
    unless ['true', 'false', 'on', 'off'].include?(value)
      raise ConfigurationError.new("Illegal value for key threads.")
    end

    if ['true', 'on'].include?(value)
      self.threads = true
    else
      self.threads = false
    end
  else
    raise ConfigurationError.new("Unknown key: #{key}.")
  end
end