Class: RGitFlow::Config
Constant Summary collapse
- CONFIG_DIR =
Dir.pwd
- CONFIG_FILE =
File.(CONFIG_DIR, '.rgitflow')
- DEFAULT_OPTIONS =
{ :master => 'master', :develop => 'develop', :feature => 'feature', :hotfix => 'hotfix', :release => 'release', :tag => 'v%s' }
Class Attribute Summary collapse
-
.options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Class Attribute Details
.options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/rgitflow/config.rb', line 4 def @options end |
Class Method Details
.load ⇒ Object
20 21 22 23 24 |
# File 'lib/rgitflow/config.rb', line 20 def self.load self. = SymbolHash.new false .update DEFAULT_OPTIONS .update read_config_file end |
.read_config_file ⇒ Object
32 33 34 35 36 37 38 39 |
# 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 ⇒ Object
26 27 28 29 30 |
# 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()) } end |