class Celebrations::PivotalTracker

Attributes

project[R]
project_id[RW]

Public Class Methods

new(env) click to toggle source
Calls superclass method Celebration::new
# File lib/release_party/celebrations/pivotal_tracker.rb, line 14
def initialize(env)
  super env
  arguments_required(:project_id, :project_api_key)

  require 'pivotal-tracker'

  @project_id = environment.project_id
  @project_api_key = environment.project_api_key

  ::PivotalTracker::Client.token = environment.project_api_key

  begin
    @project = ::PivotalTracker::Project.find(environment.project_id)
  rescue RestClient::Request::Unauthorized => e
    announce 'Unable to authenticate with pivotal, perhaps your API key is wrong.' +
      "Message: #{e.message}"
  end
end

Public Instance Methods

after_deploy() click to toggle source
# File lib/release_party/celebrations/pivotal_tracker.rb, line 38
def after_deploy
  # Deliver all finished stories if the deliver_finished flag is set
  if environment.deliver_finished? && environment.deliver_finished
    finished_stories.each do |story|
      story.update(:current_state => 'delivered')
    end
  end
end
before_deploy() click to toggle source
# File lib/release_party/celebrations/pivotal_tracker.rb, line 33
def before_deploy
  environment.finished_stories = finished_stories
  environment.known_bugs = known_bugs
end