travis 1.8.5.travis.791.4 → 1.8.5.travis.793.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/travis/tools/github.rb +4 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b9c5f9724e3878c47bb8c7a1a9084f3a64292cb
4
- data.tar.gz: d3c611ac306c10e4e4ffc2c7f0a179495168f85c
3
+ metadata.gz: 6dcbe6853f772d517c4bbeafdea807282dbd6ae9
4
+ data.tar.gz: 770a0b2eafb71771b8d265984bb271a91187d585
5
5
  SHA512:
6
- metadata.gz: 25e4775422e0dfba4381e7e480cb81a90cd30f62c45b4bdbbe26fe0901f1ba0f76730d0e45fdaef590e8f2da0d9d5ae0d49eeca900343dad4485326126f8401f
7
- data.tar.gz: 3da725f5e470a49f8a13ccb01ea8f7c0dde74631d861b64f07f6e69bb7bf864915eb436031dbbaaeb9eb2f7a5f3f13fc2df2510c30fc2ee9b4dd19489b6e3f87
6
+ metadata.gz: d5485df7392197b479026138827d0f175d8d1f2362e25258502804586ad0acf4593bdca44c29ab60f5c926a795e223dc6a0b9cb986fe0ce7fb56463456f5818d
7
+ data.tar.gz: 063724a0e9c1bfbcbdff83cb2b12e5050fd44173e9fb2feb0dfe811ddfaf23c49a047b64c52ea500f3701f008e6e4d4d7a6069c9893b0e54cc219dae6abeec9c
@@ -38,7 +38,7 @@ module Travis
38
38
 
39
39
  def with_basic_auth(&block)
40
40
  user, password = ask_credentials
41
- basic_auth(user, password, true) do |gh|
41
+ basic_auth(user, password, true) do |gh, _|
42
42
  gh['user'] # so otp kicks in
43
43
  yield gh
44
44
  end
@@ -212,10 +212,10 @@ module Travis
212
212
  end
213
213
 
214
214
  def login(user, password, die = true, otp = nil)
215
- basic_auth(user, password, die, otp) do |gh|
215
+ basic_auth(user, password, die, otp) do |gh, new_otp|
216
216
  reply = create_token(gh)
217
217
  auth_href = reply['_links']['self']['href']
218
- self.callback = proc { with_otp(gh, user, otp) { |g| g.delete(auth_href) } } if drop_token
218
+ self.callback = proc { with_otp(gh, user, new_otp) { |g| g.delete(auth_href) } } if drop_token
219
219
  reply['token']
220
220
  end
221
221
  end
@@ -232,7 +232,7 @@ module Travis
232
232
 
233
233
  def with_otp(gh, user, otp, &block)
234
234
  gh = GH.with(gh.options.merge(:headers => { "X-GitHub-OTP" => otp })) if otp
235
- block.call(gh)
235
+ block.call(gh, otp)
236
236
  rescue GH::Error => error
237
237
  raise error unless error.info[:response_status] == 401 and error.info[:response_headers]['x-github-otp'].to_s =~ /required/
238
238
  otp = ask_otp.arity == 0 ? ask_otp.call : ask_otp.call(user)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.5.travis.791.4
4
+ version: 1.8.5.travis.793.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase