Class: GitWorkflow::Commands::Finish

Inherits:
Base
  • Object
show all
Defined in:
lib/git_workflow/commands/finish.rb

Constant Summary

Constants included from GitWorkflow::CommandLine

GitWorkflow::CommandLine::InvalidCommandLine

Instance Method Summary collapse

Methods inherited from Base

#command_specific_options

Methods included from Git

#checkout_or_create_branch, #get_config_value_for, #get_config_value_for!, #in_git_branch, #merge_branch, #repository, #set_config_value

Methods included from Logging

default_logger, included, logger, logger=

Methods included from Execution

#execute_command, #execute_command_with_output_handling

Constructor Details

#initialize(command_line_arguments) ⇒ Finish

Returns a new instance of Finish.



7
8
9
10
11
12
# File 'lib/git_workflow/commands/finish.rb', line 7

def initialize(command_line_arguments)
  super(command_line_arguments) do |remaining_arguments|
    @story_id, @target_branch = remaining_arguments
    @target_branch ||= 'master'
  end
end

Instance Method Details

#executeObject



14
15
16
17
18
19
# File 'lib/git_workflow/commands/finish.rb', line 14

def execute
  story_or_current_branch(@story_id) do |story|
    finish(story, @target_branch)
    finish_story_on_pivotal_tracker!(story)
  end
end