Class: Gitit::Config

Inherits:
Object
  • Object
show all
Includes:
CommandExecutor
Defined in:
lib/gitit/command_config.rb

Overview



Instance Attribute Summary

Attributes included from CommandExecutor

#repo

Instance Method Summary collapse

Methods included from CommandExecutor

#executeCommand

Constructor Details

#initialize(repo) ⇒ Config





15
16
17
# File 'lib/gitit/command_config.rb', line 15

def initialize(repo)
  @repo = repo
end

Instance Method Details

#getValue(key, decrypt = false) ⇒ Object





21
22
23
24
25
26
# File 'lib/gitit/command_config.rb', line 21

def getValue(key, decrypt = false)
  value = executeCommand("config --null --get #{key}")
  raise "failure running command" if $?.exitstatus != 0
  value = value.slice!(0, value.length-1)
  return value
end

#setValue(key, value) ⇒ Object





30
31
32
33
34
# File 'lib/gitit/command_config.rb', line 30

def setValue(key, value)
  val = value
  executeCommand("config \"#{key}\" \"#{val}\"")
  raise "failure running command" if $?.exitstatus != 0
end