Sha256: f550b4c8e088d3200e53956b206f2253939002e27040c991588785f2e8b2d200

Contents?: true

Size: 830 Bytes

Versions: 2

Compression:

Stored size: 830 Bytes

Contents

require 'pivotal-tracker'

module DeployAndDeliver
  class Project
    attr_reader :project

    def initialize(context)
      PivotalTracker::Client.use_ssl = context[:pivotal_tracker_ssl]
      PivotalTracker::Client.token = context[:pivotal_tracker_token]
      @project = PivotalTracker::Project.find(context[:pivotal_tracker_project_id])
    end
  
    def deliver_and_report
      stories = project.stories.all(:current_state => 'finished')
      stories.each{|story| story.update :current_state => 'delivered'}
      
      puts "* delivered #{stories.size} stories (#{stories.inject{|sum=0, story| sum + story.estimate}} points)"
      stories.each do |story|
        puts "  - #{story.story_type.capitalize}: #{story.name} (#{story.estimate} #{story.estimate == 1 ? "point" : "points"})"
      end
    end
  end
    
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
deploy_and_deliver-2.1.1 lib/deploy_and_deliver.rb
deploy_and_deliver-2.1.0 lib/deploy_and_deliver.rb