gem_version_check 0.5.1 → 0.5.2

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: 139688c648650e4a434fb1a5c3ca729d7e55a606
4
- data.tar.gz: bb5fd2d95f7d6365f26f37f6bc279d2bf4c7023f
3
+ metadata.gz: ca4555e0f6aa6c50880e033511160aff7734589e
4
+ data.tar.gz: 920cf30fe393e38b8c5ce21cb5bd33f2e1442d43
5
5
  SHA512:
6
- metadata.gz: 1fd0fb3723dfe496361df760675bdcce509bb01ce144b364c13e161e410c26b9c72f456d031698ef27b3b7aeec27db06fc658ef58db93839a7cdad6b808c2706
7
- data.tar.gz: 7318c509ad4a07b406f2ab756972f0694d598e665ce36d6ca499d9711dd5f4b2cc8342568bc249132cbc27c2105f131c8f2b527e86d5295ac50532c3c170113f
6
+ metadata.gz: 9469d853daa9133b2febff950eb91631b6b3e3d70084841acee92dda12b342eda56c408b2d472b4ac7151754566eb254bed924dc20c91da4fd0a2f9383d47231
7
+ data.tar.gz: e78b2e6557f2d8260981a297ce417eaa6c0c4730fbe8874091cc8b911d0bb50cffbaca1711bab57d1d8fb219f3da442b257c2f3bdb8ea0894cc937ad98d23b14
@@ -28,13 +28,11 @@ module GemVersionCheck
28
28
  # github enterprise does not redirect
29
29
  # TODO: change if github enterprise redirects too
30
30
  def gemfile_lock_url
31
- token = GemVersionCheck.configuration.token
31
+ host = GemVersionCheck.configuration.github_host
32
32
  if GemVersionCheck.configuration.github_host == "github.com"
33
- "https://raw.#{GemVersionCheck.configuration.github_host}/#{@project}/master/Gemfile.lock"
34
- elsif token
35
- "https://#{GemVersionCheck.configuration.github_host}/raw/#{@project}/master/Gemfile.lock?token=#{token}"
33
+ "https://raw.#{host}/#{@project}/master/Gemfile.lock"
36
34
  else
37
- "https://#{GemVersionCheck.configuration.github_host}/raw/#{@project}/master/Gemfile.lock"
35
+ "https://#{host}/raw/#{@project}/master/Gemfile.lock"
38
36
  end
39
37
  end
40
38
 
@@ -42,6 +40,9 @@ module GemVersionCheck
42
40
  http = Net::HTTP.new(uri.host, uri.port)
43
41
  http.use_ssl = true if uri.scheme == 'https'
44
42
  request = Net::HTTP::Get.new(uri.request_uri)
43
+ if token = GemVersionCheck.configuration.token
44
+ request.basic_auth token, 'x-oauth-basic'
45
+ end
45
46
  response = http.request(request)
46
47
  if response.code == "200"
47
48
  response.body
@@ -1,3 +1,3 @@
1
1
  module GemVersionCheck
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_version_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederik Dietz