Class: GitPivotalTrackerIntegration::Util::Story
- Inherits:
-
Object
- Object
- GitPivotalTrackerIntegration::Util::Story
- Defined in:
- lib/git-pivotal-tracker-integration/util/story.rb
Overview
Utilities for dealing with PivotalTracker::Storys
Class Method Summary collapse
-
.pretty_print(story) ⇒ void
Print a human readable version of a story.
-
.select_story(project, filter = nil, limit = 5) ⇒ PivotalTracker::Story
Selects a Pivotal Tracker story by doing the following steps:.
Class Method Details
.pretty_print(story) ⇒ void
This method returns an undefined value.
Print a human readable version of a story. This pretty prints the title, description, and notes for the story.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/git-pivotal-tracker-integration/util/story.rb', line 28 def self.pretty_print(story) print_label LABEL_TITLE print_value story.name description = story.description if !description.nil? && !description.empty? print_label 'Description' print_value description end PivotalTracker::Note.all(story).sort_by { |note| note.noted_at }.each_with_index do |note, index| print_label "Note #{index + 1}" print_value note.text end puts end |
.select_story(project, filter = nil, limit = 5) ⇒ PivotalTracker::Story
Selects a Pivotal Tracker story by doing the following steps:
56 57 58 59 60 61 62 63 64 |
# File 'lib/git-pivotal-tracker-integration/util/story.rb', line 56 def self.select_story(project, filter = nil, limit = 5) if filter =~ /[[:digit:]]/ story = project.stories.find filter.to_i else story = find_story project, filter, limit end story end |