bel_parser 1.0.3-java → 1.0.4-java
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: ce3dec94758500ca12f20ec16d93cbf01874a8d3
|
4
|
+
data.tar.gz: 21510b5bc83a203e446ab76b9a19d7daca380731
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e30b2bbb3c9ea3a736931ed056ed28b65635aa46a545f3c3a3ca72481f7a37cbeff080ede1b5a94ccec76bd6fa7680bbac1d63ac0310378e2a40c0ede402b03
|
7
|
+
data.tar.gz: 9b4b54e45db28ebbe356cb0942bcd89e845eaefcb04c68b574a5f145587151af9ad228cf9b7bc950fe53a8e4ecd980be6eff7f31645af6bc3eb1e0a295fe647a
|
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 ||= {}
|