heroku-api 0.3.9 → 0.3.10

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ .rvmrc
@@ -1,3 +1,11 @@
1
+ 0.3.10 05/13/2013
2
+ =================
3
+
4
+ add exception for rate limiting
5
+ better user/pass handling at login
6
+ avoid dumping user/pass on error
7
+ bump excon dep
8
+
1
9
  0.3.9 04/01/2013
2
10
  ================
3
11
 
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
17
  s.require_paths = ["lib"]
18
18
 
19
- s.add_runtime_dependency 'excon', '~>0.20.1'
19
+ s.add_runtime_dependency 'excon', '~>0.21.0'
20
20
 
21
21
  s.add_development_dependency 'minitest'
22
22
  s.add_development_dependency 'rake'
@@ -57,8 +57,10 @@ module Heroku
57
57
 
58
58
  @api_key = options.delete(:api_key) || ENV['HEROKU_API_KEY']
59
59
  if !@api_key && options.has_key?(:username) && options.has_key?(:password)
60
+ username = options.delete(:username)
61
+ password = options.delete(:password)
60
62
  @connection = Excon.new("#{options[:scheme]}://#{options[:host]}", options.merge(:headers => HEADERS))
61
- @api_key = self.post_login(options[:username], options[:password]).body["api_key"]
63
+ @api_key = self.post_login(username, password).body["api_key"]
62
64
  end
63
65
 
64
66
  user_pass = ":#{@api_key}"
@@ -86,6 +88,7 @@ module Heroku
86
88
  when 408 then Heroku::API::Errors::Timeout
87
89
  when 422 then Heroku::API::Errors::RequestFailed
88
90
  when 423 then Heroku::API::Errors::Locked
91
+ when 429 then Heroku::API::Errors::RateLimitExceeded
89
92
  when /50./ then Heroku::API::Errors::RequestFailed
90
93
  else Heroku::API::Errors::ErrorWithResponse
91
94
  end
@@ -1,5 +1,5 @@
1
1
  module Heroku
2
2
  class API
3
- VERSION = "0.3.9"
3
+ VERSION = "0.3.10"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.9
4
+ version: 0.3.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-01 00:00:00.000000000 Z
12
+ date: 2013-05-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: excon
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 0.20.1
21
+ version: 0.21.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 0.20.1
29
+ version: 0.21.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: minitest
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -142,18 +142,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
142
  - - ! '>='
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
- segments:
146
- - 0
147
- hash: 535685134702822374
148
145
  required_rubygems_version: !ruby/object:Gem::Requirement
149
146
  none: false
150
147
  requirements:
151
148
  - - ! '>='
152
149
  - !ruby/object:Gem::Version
153
150
  version: '0'
154
- segments:
155
- - 0
156
- hash: 535685134702822374
157
151
  requirements: []
158
152
  rubyforge_project:
159
153
  rubygems_version: 1.8.23
@@ -180,3 +174,4 @@ test_files:
180
174
  - test/test_ssl_endpoints.rb
181
175
  - test/test_stacks.rb
182
176
  - test/test_user.rb
177
+ has_rdoc: