Class: Celebrations::PivotalTracker
- Inherits:
-
Celebration
- Object
- Celebration
- Celebrations::PivotalTracker
- Includes:
- Announce
- Defined in:
- lib/release_party/celebrations/pivotal_tracker.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
Attributes inherited from Celebration
Instance Method Summary collapse
- #after_deploy ⇒ Object
- #before_deploy ⇒ Object
-
#initialize(env) ⇒ PivotalTracker
constructor
A new instance of PivotalTracker.
Methods included from Announce
Methods inherited from Celebration
Constructor Details
#initialize(env) ⇒ PivotalTracker
Returns a new instance of PivotalTracker.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# 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.}" end end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
12 13 14 |
# File 'lib/release_party/celebrations/pivotal_tracker.rb', line 12 def project @project end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
11 12 13 |
# File 'lib/release_party/celebrations/pivotal_tracker.rb', line 11 def project_id @project_id end |
Instance Method Details
#after_deploy ⇒ Object
38 39 40 41 42 43 44 45 |
# 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 ⇒ Object
33 34 35 36 |
# File 'lib/release_party/celebrations/pivotal_tracker.rb', line 33 def before_deploy environment.finished_stories = finished_stories environment.known_bugs = known_bugs end |