Class: Codelog::Command::New
- Inherits:
-
Object
- Object
- Codelog::Command::New
- Includes:
- FileUtils
- Defined in:
- lib/codelog/command/new.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, options) ⇒ New
constructor
A new instance of New.
- #run ⇒ Object
Constructor Details
#initialize(name, options) ⇒ New
Returns a new instance of New.
8 9 10 11 |
# File 'lib/codelog/command/new.rb', line 8 def initialize(name, ) @name = name @options = end |
Class Method Details
.run(name, options) ⇒ Object
13 14 15 |
# File 'lib/codelog/command/new.rb', line 13 def self.run(name, ) new(name, ).run end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/codelog/command/new.rb', line 17 def run chdir Dir.pwd do # This script create a change file for the changelog documentation. @file_name = "changelogs/unreleased/#{}_#{change_file_name}.yml" if @options[:interactive] build_from_hash Codelog::CLIs::Interactive.new.run else build_from_template end system! "#{default_editor} #{@file_name}" if @options[:edit] end end |