heroku_deployer 0.7.8 → 0.7.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f146241d18617d28406f8d3491bf3d1569ee7261
4
- data.tar.gz: 4a924881d7293f655693f2b44efb53f0f8627a8f
3
+ metadata.gz: bf46a1d4195720d38e9ed25531f209843c48901f
4
+ data.tar.gz: 422d9f49e108e016e7a3349bb016c6706c1ed6d0
5
5
  SHA512:
6
- metadata.gz: 5ef1e8b6f771995d9f57d7c5bb0adc9c708ac84416e8e2613e89bcc596d0f5fe346405d9de9175732d0e2e4c8977f712933eee22e9395ae56880c5c4b29847dd
7
- data.tar.gz: 4419b391b1faed460c1145b3bdeb3cef0fe174809816fccad9a40b34ba1118963633272c559997aedd8644cde49396cd4dbeafbeba5e510fed5daf0d2a447e06
6
+ metadata.gz: 73d79b720e4b7ecc65cbb7451cf3dc8a07033e3f121ed5de6f1043739f8e48a27999a3cf38d7b31e98e79a726a3dd21fc431d36ff16e9f566f63ed88533830f4
7
+ data.tar.gz: 9361adf4789b1294dc512cbbbd11eea6206639c8694a8f035eb844b7482327fc0ca84626a3c6864997121f15b9a84d1efd4e46d9037df86f379e3e937ce7eb13
@@ -1,11 +1,10 @@
1
1
  require 'amitree/git_client'
2
2
  require 'amitree/heroku_client'
3
+ require 'amitree/utils'
3
4
  require 'pivotal-tracker'
4
5
 
5
6
  module Amitree
6
7
  class HerokuDeployer
7
- attr_reader :tracker_project
8
-
9
8
  class ReleaseDetails
10
9
  attr_accessor :production_release, :staging_release_to_deploy, :stories
11
10
  attr_writer :production_promoted_from_staging
@@ -43,7 +42,7 @@ module Amitree
43
42
  @heroku = options[:heroku] || Amitree::HerokuClient.new(options[:heroku_api_key], options[:heroku_staging_app], options[:heroku_production_app])
44
43
  @git = options[:git] || Amitree::GitClient.new(options[:github_repo], options[:github_username], options[:github_password])
45
44
  PivotalTracker::Client.token = options[:tracker_token]
46
- @tracker_project = PivotalTracker::Project.find(options[:tracker_project_id])
45
+ @tracker_projects = PivotalTracker::Project.all
47
46
  @tracker_cache = {}
48
47
  end
49
48
 
@@ -98,7 +97,9 @@ module Amitree
98
97
  end
99
98
 
100
99
  def tracker_data(story_id)
101
- @tracker_cache[story_id] ||= @tracker_project.stories.find(story_id)
100
+ @tracker_cache[story_id] ||= @tracker_projects.map_detect do |project|
101
+ project.stories.find(story_id)
102
+ end
102
103
  end
103
104
 
104
105
  def stories_worked_on_between(rev1, rev2)
@@ -108,5 +109,9 @@ module Amitree
108
109
  end
109
110
  end.compact
110
111
  end
112
+
113
+ def tracker_project(project_id)
114
+ @tracker_projects.detect{|project| project.id == project_id.to_i} or raise "Unknown project id: #{project_id}"
115
+ end
111
116
  end
112
117
  end
@@ -0,0 +1,5 @@
1
+ module Enumerable
2
+ def map_detect &block
3
+ lazy.map(&block).detect{|x| x}
4
+ end
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku_deployer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.8
4
+ version: 0.7.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Wargnier
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-30 00:00:00.000000000 Z
12
+ date: 2015-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -91,6 +91,7 @@ files:
91
91
  - lib/amitree/git_client.rb
92
92
  - lib/amitree/heroku_client.rb
93
93
  - lib/amitree/heroku_deployer.rb
94
+ - lib/amitree/utils.rb
94
95
  homepage: http://rubygems.org/gems/heroku_deployer
95
96
  licenses:
96
97
  - MIT