Class: GitWorkflow::Commands::Start

Inherits:
Base
  • Object
show all
Defined in:
lib/git_workflow/commands/start.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) ⇒ Start

Returns a new instance of Start.



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

def initialize(command_line_arguments)
  super(command_line_arguments) do |remaining_arguments|
    @story_id, @parent_branch = remaining_arguments
    raise InvalidCommandLine, 'The command line is invalid' if @story_id.nil?
  end
end

Instance Method Details

#executeObject



13
14
15
16
17
18
19
20
21
# File 'lib/git_workflow/commands/start.rb', line 13

def execute
  story(@story_id) do |story|
    start(story, @parent_branch)
    start_story_on_pivotal_tracker!(story)
  
    $stdout.puts "Story #{ story.story_id }: #{ story.name }"
    $stdout.puts story.description
  end
end