bel_parser 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/bel_parser/resource/sparql_reader.rb +2 -3
- data/lib/bel_parser/resource.rb +8 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cee37750129d98c6ebb23306cf320d2c3d487fd
|
4
|
+
data.tar.gz: 5cb260daec5153b1ee13609d36f77061c63ecd31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55ea0d27228e94075296bc69f20cb9cb134f7d2fd0d310f427b0b8736fadbc44f708cbfb0191254869d4c6051f1d45053b8313d9f4df406bc4dc2195a06df78a
|
7
|
+
data.tar.gz: 1f002cbf2704df4fc4db3df20db58ff3841bab479a7b6efa5c52ad037cc2ae1c24d31ea372226efa6232dd6483f3e0ab0b7eb60e188148591fdc9d5c246e2c9d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.4
|
@@ -81,10 +81,9 @@ module BELParser
|
|
81
81
|
scheme, host, port = URI(url_s).select(:scheme, :host, :port)
|
82
82
|
validate_uri_scheme(scheme, url_s)
|
83
83
|
|
84
|
+
http = Net::HTTP.start(host, port)
|
84
85
|
options_request = Net::HTTP::Options.new(url_s)
|
85
|
-
options_response =
|
86
|
-
http.request(Net::HTTP::Options.new(url_s))
|
87
|
-
end
|
86
|
+
options_response = http.request(options_request)
|
88
87
|
validate_200(options_response, url_s)
|
89
88
|
validate_allowed_methods(options_response, url_s)
|
90
89
|
end
|
data/lib/bel_parser/resource.rb
CHANGED
@@ -60,20 +60,16 @@ module BELParser
|
|
60
60
|
request['Range'] = 'bytes=0-5000'
|
61
61
|
resource_uri = nil
|
62
62
|
|
63
|
-
Net::HTTP.
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
if uristring
|
71
|
-
resource_uri = uristring.match(URISTRING_PATTERN)[1]
|
72
|
-
break
|
73
|
-
end
|
63
|
+
http = Net::HTTP.new(uri.hostname, uri.port)
|
64
|
+
http.request(request) do |response|
|
65
|
+
response.read_body do |chunk|
|
66
|
+
uristring = chunk.lines.detect { |l| l =~ URISTRING_PATTERN }
|
67
|
+
if uristring
|
68
|
+
resource_uri = uristring.match(URISTRING_PATTERN)[1]
|
69
|
+
break
|
74
70
|
end
|
75
71
|
end
|
76
|
-
|
72
|
+
end
|
77
73
|
|
78
74
|
RESOLVE_URI_LOCK.synchronize do
|
79
75
|
@uri_hash ||= {}
|