Class: Releasinator::ConfigHash
- Inherits:
-
Hash
- Object
- Hash
- Releasinator::ConfigHash
- Defined in:
- lib/config_hash.rb
Instance Method Summary collapse
-
#initialize(verbose, trace) ⇒ ConfigHash
constructor
A new instance of ConfigHash.
- #use_git_flow ⇒ Object
Constructor Details
#initialize(verbose, trace) ⇒ ConfigHash
Returns a new instance of ConfigHash.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/config_hash.rb', line 11 def initialize(verbose, trace) update({:releasinator_name => RELEASINATOR_NAME}) update({:verbose => verbose}) update({:trace => trace}) require_file_name = "./.#{RELEASINATOR_NAME}.rb" begin require require_file_name rescue LoadError is_git_already_clean = GitUtil.is_clean_git? puts "It looks like this is your first time using #{RELEASINATOR_NAME} on this project.".yellow puts "A default '#{CONFIG_FILE_NAME}' file has been created for you.".yellow out_file = File.new("#{CONFIG_FILE_NAME}", "w") out_file.write(DEFAULT_CONFIG) out_file.close require require_file_name # dpn't want to commit other files if is_git_already_clean puts "adding default #{CONFIG_FILE_NAME} to git".yellow CommandProcessor.command("git add #{CONFIG_FILE_NAME}") CommandProcessor.command("git commit -m \"#{RELEASINATOR_NAME}: add default config\"") end end configatron.lock! loaded_config_hash = configatron.to_h update(loaded_config_hash) puts "loaded config:" + self.to_s if verbose end |
Instance Method Details
#use_git_flow ⇒ Object
44 45 46 47 |
# File 'lib/config_hash.rb', line 44 def use_git_flow() return self[:use_git_flow] if self.has_key? :use_git_flow false end |