Class: GradesFirst::BranchCommand
- Defined in:
- lib/gradesfirst/branch_command.rb
Overview
Implemenation of a Thor command for enhancing git branch to include PivotalTracker information such as the story state, name and url.
Class Method Summary collapse
-
.description ⇒ Object
Description of the gf branch Thor command that will be used in the commandline help.
Instance Method Summary collapse
-
#execute ⇒ Object
Performs the gf branch Thor command.
-
#initialize ⇒ BranchCommand
constructor
A new instance of BranchCommand.
-
#response ⇒ Object
Output response of the gf branch Thor command that contains the PivotalTracker enhanced branch names.
Constructor Details
#initialize ⇒ BranchCommand
Returns a new instance of BranchCommand.
15 16 17 |
# File 'lib/gradesfirst/branch_command.rb', line 15 def initialize @enhanced_branches = [] end |
Class Method Details
.description ⇒ Object
Description of the gf branch Thor command that will be used in the commandline help.
11 12 13 |
# File 'lib/gradesfirst/branch_command.rb', line 11 def self.description 'List git branches with related PivotalTracker story information.' end |
Instance Method Details
#execute ⇒ Object
Performs the gf branch Thor command.
20 21 22 23 24 25 26 |
# File 'lib/gradesfirst/branch_command.rb', line 20 def execute git_response = git_branch git_response.each_line do |branch| @enhanced_branches << enhanced_branch(branch.rstrip) end nil end |
#response ⇒ Object
Output response of the gf branch Thor command that contains the PivotalTracker enhanced branch names.
30 31 32 |
# File 'lib/gradesfirst/branch_command.rb', line 30 def response @enhanced_branches.join("\n") + "\n" end |