Class: GitFit::CLI
- Inherits:
-
Thor
- Object
- Thor
- GitFit::CLI
- Defined in:
- lib/git_fit/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
9 10 11 |
# File 'lib/git_fit/cli.rb', line 9 def self.exit_on_failure? true end |
Instance Method Details
#init ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/git_fit/cli.rb', line 20 def init path = [:output] || "config/config.yml" FileUtils.mkdir_p(File.dirname(path)) if File.exist?(path) existing = YAML.safe_load(File.read(path)) || {} merged = deep_merge(ConfigTemplate.hash, existing) File.write(path, YAML.dump(merged)) say_status :merged, path, :green else File.write(path, ConfigTemplate.generate) say_status :created, path, :green end end |