Class: GradesFirst::CommitMessageCommand
- Defined in:
- lib/gradesfirst/commit_message_command.rb
Overview
Implementation of a Thor command for creating a git commit message that already includes the information from the related PivotalTracker story associated with the current branch.
Class Method Summary collapse
-
.description ⇒ Object
Description of the gf commit-message Thor command that well be usewd in the commandline help.
Instance Method Summary collapse
-
#execute ⇒ Object
Performs the gf commit-message Thor command.
-
#response ⇒ Object
Output response of the gf commit-message Thor command in the standard format.
Class Method Details
.description ⇒ Object
Description of the gf commit-message Thor command that well be usewd in the commandline help.
12 13 14 |
# File 'lib/gradesfirst/commit_message_command.rb', line 12 def self.description 'Generate a git commit message in the standard format.' end |
Instance Method Details
#execute ⇒ Object
Performs the gf commit-message Thor command.
17 18 19 |
# File 'lib/gradesfirst/commit_message_command.rb', line 17 def execute @story = current_story end |
#response ⇒ Object
Output response of the gf commit-message Thor command in the standard format.
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/gradesfirst/commit_message_command.rb', line 23 def response if @story.nil? '' else = [ "", "", constrain_line_length(@story['name'], 72), @story['url'] ] .join("\n") + "\n" end end |