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'
  }
}

Class Method Summary collapse

Class Method Details

.set(key, value) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/mgit/configuration.rb', line 18

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