lib/pivotal-integration/command/start.rb
# Starts a Pivotal Tracker story by doing the following steps:
# * Create a branch
# * Add default commit hook
# * Start the story on Pivotal Tracker
#
# @param [String, nil] filter a filter for selecting the story to start.  This
#   filter can be either:
#   * a story id
#   * a story type (feature, bug, chore)
#   * +nil+
# @return [void]
Starts a Pivotal Tracker story by doing the following steps:
Create a branch
Add default commit hook
Start the story on Pivotal Tracker
Starts a Pivotal Tracker story by doing the following steps : Create a branch Add default commit hook Start the story on Pivotal Tracker
def run(*arguments)
    filter = arguments.first
    use_current_branch = @options.fetch(:use_current, false)
    if filter == 'new'
      arguments.shift
      story = PivotalIntegration::Util::Story.new(@project, *PivotalIntegration::Command::New.collect_type_and_name(@project, arguments))
    else
      story = PivotalIntegration::Util::Story.select_story @project, filter
    end
    if story.estimate.nil? or story.estimate == -1
      PivotalIntegration::Util::Story.estimate(story, PivotalIntegration::Command::Estimate.collect_estimation(@project))
    end
    PivotalIntegration::Util::Story.pretty_print story
    development_branch_name = development_branch_name story
    base_branch = PivotalIntegration::Util::Git.get_config_with_default 'pivotal.develop-branch', 'master'
    PivotalIntegration::Util::Git.switch_branch base_branch unless use_current_branch
    PivotalIntegration::Util::Git.create_branch development_branch_name
    @configuration.story = story
    PivotalIntegration::Util::Git.add_hook 'prepare-commit-msg', File.join(File.dirname(__FILE__), 'prepare-commit-msg.sh')
    start_on_tracker story
  end
def run ( * arguments ) filter = arguments . first use_current_branch = @options . fetch ( :use_current , false ) if filter == 'new' arguments . shift story = PivotalIntegration :: Util :: Story . new ( @project , * PivotalIntegration :: Command :: New . collect_type_and_name ( @project , arguments ) ) else story = PivotalIntegration :: Util :: Story . select_story @project , filter end if story . estimate . nil? or story . estimate == - 1 PivotalIntegration :: Util :: Story . estimate ( story , PivotalIntegration :: Command :: Estimate . collect_estimation ( @project ) ) end PivotalIntegration :: Util :: Story . pretty_print story development_branch_name = development_branch_name story base_branch = PivotalIntegration :: Util :: Git . get_config_with_default 'pivotal.develop-branch' , 'master' PivotalIntegration :: Util :: Git . switch_branch base_branch unless use_current_branch PivotalIntegration :: Util :: Git . create_branch development_branch_name @configuration . story = story PivotalIntegration :: Util :: Git . add_hook 'prepare-commit-msg' , File . join ( File . dirname ( __FILE__ ) , 'prepare-commit-msg.sh' ) start_on_tracker story end
Starts a Pivotal Tracker story by doing the following steps:
 Create a branch
 Add default commit hook
 Start the story on Pivotal Tracker
Starts a Pivotal Tracker story by doing the following steps : Create a branch Add default commit hook Start the story on Pivotal Tracker
None
void
arguments
filter a filter for selecting the story to start. This filter can be either: * a story id * a story type (feature, bug, chore) * +nil+
filter a filter for selecting the story to start . This filter can be either : * a story id * a story type ( feature bug chore ) * + nil +