brew-github-bottles 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7779910b8412612bcf97e8ce8bd9a384c466001
4
- data.tar.gz: a542c2a1d030d5c4706e28db298a116448d11608
3
+ metadata.gz: c230cb586c65b3fdcb59346869b08fc7ae302a9a
4
+ data.tar.gz: f9cb6a91b32cfa7586b979189983e52141468ea6
5
5
  SHA512:
6
- metadata.gz: 46bf6c1ae5c397455866e7d9abbd7ccf6857fa1e6276a21118c7e519491f2accd83bb103529d1a2586c3427d6a97b11148780f0696357c9d49f43568ece3f8b6
7
- data.tar.gz: c82a10ce47fc53f781bc3295ae5cf81c71bf5e951aba29876631bf5147f2153da7155aaec11c0805487d39b40c5b583d035b198b9914b6ffb750cf51d7269832
6
+ metadata.gz: 4dca3f3ce80fd15ffaae234b9e005be4fa66e4c566f420b7776ea6481e87081e679b6e79bb33b6968d7849042b515019e4a035cca078484891893c60e67b4d75
7
+ data.tar.gz: f160c3440008a732fc37b655746a19faabe4bc4c4b57e0075dea8c52302f9a74955256248348328a9dbf68960ed65449011b5279921d0e63acf6655b8ae4354b
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
@@ -106,18 +106,15 @@ class GithubBottle
106
106
  ohai "brew-github-bottles: Downloading #{asset_uri}"
107
107
 
108
108
  # Get the asset from github
109
- def build_request(uri)
110
- req = Net::HTTP::Get.new(uri)
109
+ req = Net::HTTP::Get.new(asset_uri)
111
110
 
112
- unless @authorization.nil?
113
- req["Authorization"] = @authorization
114
- end
115
-
116
- req["Accept"] = "application/octet-stream"
117
- req
111
+ unless @authorization.nil?
112
+ req["Authorization"] = @authorization
118
113
  end
119
114
 
120
- res = send_request(asset_uri, build_request(asset_uri))
115
+ req["Accept"] = "application/octet-stream"
116
+
117
+ res = send_request(asset_uri, req)
121
118
 
122
119
  data = ""
123
120
  begin
@@ -125,10 +122,8 @@ class GithubBottle
125
122
  when Net::HTTPSuccess then
126
123
  data = res.body
127
124
  when Net::HTTPRedirection then
128
- # Follow the redirect
129
- redirect_uri = URI(res["location"])
130
- new_req = build_request(redirect_uri)
131
- res = send_request(redirect_uri, new_req)
125
+ # Follow the redirect, which already includes the credentials
126
+ res = Net::HTTP.get_response(URI(res['location']))
132
127
  unless Net::HTTPOK === res
133
128
  raise
134
129
  end
@@ -3,7 +3,7 @@ module Homebrew
3
3
  module Bottles
4
4
  #TODO: A version that pulls from git
5
5
  #VERSION = `git describe`.tr! '-', '.'
6
- VERSION = '0.3.0'
6
+ VERSION = '0.3.1'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brew-github-bottles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Meacham