pinch 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pinch.rb +1 -8
- data/spec/pinch_spec.rb +0 -11
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 453f4b28e5090149f8b945f3f0580ec7c86bb03d
|
4
|
+
data.tar.gz: 6fc91dd51d7da613238e8d666df447675b0c8a04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d870cd1eacf3eb19338758332abbf746610cf09a930f72708bc0914650d3fde4dff1eaa065deb5d821aa02a16ec24495a980210191bb196d36ba22cb93af1044
|
7
|
+
data.tar.gz: 0199690caf877f1d152b7422034da937c4809fadfc49035da30193b7d9f0bb6625535f2419bcc863bd8d1136fc3af6550d88a93a0ae17ec62f64516c09b54353
|
data/lib/pinch.rb
CHANGED
@@ -6,7 +6,7 @@ require 'pinch_response'
|
|
6
6
|
# @author Peter Hellberg
|
7
7
|
# @author Edward Patel
|
8
8
|
class Pinch
|
9
|
-
VERSION = "0.3.
|
9
|
+
VERSION = "0.3.3"
|
10
10
|
|
11
11
|
attr_reader :get_uri, :user, :pass
|
12
12
|
|
@@ -130,12 +130,6 @@ class Pinch
|
|
130
130
|
# Raise exception if the response code isn’t in the 2xx range
|
131
131
|
response.error! unless response.kind_of?(Net::HTTPSuccess)
|
132
132
|
|
133
|
-
# Raise exception if the server doesn’t support the Range header
|
134
|
-
unless (response['Accept-Ranges'] or "").include?('bytes')
|
135
|
-
raise RangeHeaderException,
|
136
|
-
"Range HTTP header not supported on #{@head_uri.host}"
|
137
|
-
end
|
138
|
-
|
139
133
|
response['Content-Length'].to_i
|
140
134
|
rescue Net::HTTPRetriableError => e
|
141
135
|
@head_uri = URI.parse(e.response['Location'])
|
@@ -302,6 +296,5 @@ private
|
|
302
296
|
http
|
303
297
|
end
|
304
298
|
|
305
|
-
class RangeHeaderException < StandardError; end
|
306
299
|
class TooManyRedirects < StandardError; end
|
307
300
|
end
|
data/spec/pinch_spec.rb
CHANGED
@@ -30,17 +30,6 @@ end
|
|
30
30
|
require File.dirname(__FILE__) + '/../lib/pinch'
|
31
31
|
|
32
32
|
describe Pinch do
|
33
|
-
describe "url that redirects to the pinch zipball" do
|
34
|
-
it "should throw an exception about missing Range header support on GitHub" do
|
35
|
-
VCR.use_cassette('pinch_zipball') do
|
36
|
-
@url = 'https://github.com/peterhellberg/pinch/zipball/master'
|
37
|
-
lambda {
|
38
|
-
Pinch.file_list(@url)
|
39
|
-
}.must_raise Pinch::RangeHeaderException
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
33
|
describe "when calling get on a compressed ZIP file" do
|
45
34
|
it "should return the contents of the file" do
|
46
35
|
VCR.use_cassette('squeak') do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pinch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Hellberg
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-06-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.
|
96
|
+
rubygems_version: 2.4.6
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: Retrieve a file from inside a zip file, over the network!
|