class RGitFlow::Config
Constants
- CONFIG_DIR
- CONFIG_FILE
- DEFAULT_OPTIONS
Attributes
options[RW]
Public Class Methods
load()
click to toggle source
# File lib/rgitflow/config.rb, line 20 def self.load self.options = SymbolHash.new false options.update DEFAULT_OPTIONS options.update read_config_file end
read_config_file()
click to toggle source
# File lib/rgitflow/config.rb, line 32 def self.read_config_file if File.file?(CONFIG_FILE) require 'yaml' YAML.load_file(CONFIG_FILE) else {} end end
save()
click to toggle source
# File lib/rgitflow/config.rb, line 26 def self.save require 'yaml' Dir.mkdir(CONFIG_DIR) unless File.directory?(CONFIG_DIR) File.open(CONFIG_FILE, 'w') {|f| f.write(YAML.dump(options)) } end