crashwatcher/upload-gist.rb
# Parses a value that might appear in a .gitconfig file into
# something useful in a Ruby script.
Parses a value that might appear in a .gitconfig file into
something useful in a Ruby script.
Parses a value that might appear in a . gitconfig file into something useful in a Ruby script .
def str_to_bool(str)
  if str.size > 0 and str[0].chr == '!'
    command = str[1, str.length]
    value = `#{command}`
    else
    value = str
  end
  case value.downcase.strip
    when "false", "0", "nil", "", "no", "off"
    nil
    when "true", "1", "yes", "on"
    true
    else
    value
  end
end
def str_to_bool ( str ) if str . size > 0 and str [ 0 ] . chr == '!' command = str [ 1 , str . length ] value = ` #{ command } ` else value = str end case value . downcase . strip when "false" , "0" , "nil" , "" , "no" , "off" nil when "true" , "1" , "yes" , "on" true else value end end
Parses a value that might appear in a .gitconfig file into
something useful in a Ruby script.
Parses a value that might appear in a . gitconfig file into something useful in a Ruby script .
str