Module: GitPivot::Pivotal

Extended by:
Shared
Defined in:
lib/git-pivot/pivotal.rb

Class Method Summary collapse

Methods included from Shared

input, out

Class Method Details

.deliverObject



42
43
44
45
46
47
# File 'lib/git-pivot/pivotal.rb', line 42

def deliver
  current_story
  
  @story.update(current_state: :delivered)
  out "Marked story as delivered."
end

.finishObject



35
36
37
38
39
40
# File 'lib/git-pivot/pivotal.rb', line 35

def finish
  current_story

  @story.update(completed: true)
  out "Marked story as finished."
end

.infoObject



49
50
51
52
53
54
55
56
57
# File 'lib/git-pivot/pivotal.rb', line 49

def info
  current_story
"""
-- Pivotal Info --
Name: #{@story.name}
URL: #{@story.url}
Desc: #{@story.description}
"""
end

.projectObject



18
19
20
21
# File 'lib/git-pivot/pivotal.rb', line 18

def project
  tracker
  @project ||= PivotalTracker::Project.find GitPivot::Git.config 'pivotal.project-id'
end

.start(id = nil, mine = false) ⇒ Object

will ignore id if mine is true



28
29
30
31
32
33
# File 'lib/git-pivot/pivotal.rb', line 28

def start(id=nil, mine=false)
  story = (mine || id.nil?) ? project.stories.all(owned_by: user).first : project.stories.find(id)

  story.update(owned_by: user, current_state: :started)
  return [story.id, story.story_type, "Story #{id} started..."]
end

.userObject



23
24
25
# File 'lib/git-pivot/pivotal.rb', line 23

def user
  @user ||= GitPivot::Git.config 'pivotal.full-name'
end