Class: Commands::Accept

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

Instance Attribute Summary

Attributes inherited from Base

#input, #options, #output

Instance Method Summary collapse

Methods inherited from Base

#get, #initialize, #put, #sys, #with

Constructor Details

This class inherits a constructor from Commands::Base

Instance Method Details

#run!Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/commands/accept.rb', line 5

def run!
  super

  unless story_id
    put "Branch name must contain a Pivotal Tracker story id"
    return 1
  end

  if story_is_acceptable?
    accept_story!
    return 0
  else
    put "Story is not in an acceptable state. It's currently #{story.current_state}."
    return 1
  end
end