uniara_virtual_parser 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uniara_virtual_parser/client.rb +12 -2
- data/lib/uniara_virtual_parser/version.rb +1 -1
- 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: d608df32d169b7481d65450c2c39c4cf338dff6e
|
4
|
+
data.tar.gz: 5f4cace10867c2f5f48577c53e61fdde6c77e09d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64b6f31cf28c1aea5cbb6fe1de4809e3563ce5fded8a68f22068432b19cc219d2490feb56b573cc7510a8702bf1aec313e7dfb06580eb3c1a7ea98732dc7150a
|
7
|
+
data.tar.gz: 03c3e295e567c5be33f0f746697b08afa55e4377ba21e9d0b718922c264fc4f5d0d5ace63a34691c3518fc4b23ec567b49d157bd036f71a4236f0d1a7e43dace
|
@@ -9,7 +9,7 @@ module UniaraVirtualParser
|
|
9
9
|
|
10
10
|
class << self
|
11
11
|
def get_with_token(path, token)
|
12
|
-
uri = URI("#{
|
12
|
+
uri = URI("#{endpoint}#{path}")
|
13
13
|
req = Net::HTTP::Get.new(uri)
|
14
14
|
req['Cookie'] = "PHPSESSID=#{token};"
|
15
15
|
res = Net::HTTP.start(uri.hostname, uri.port) do |http|
|
@@ -18,9 +18,19 @@ module UniaraVirtualParser
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def post(path, body=nil)
|
21
|
-
uri = URI("#{
|
21
|
+
uri = URI("#{endpoint}#{path}")
|
22
22
|
Net::HTTP.post_form(uri, body)
|
23
23
|
end
|
24
|
+
|
25
|
+
def configure_endpoint(endpoint)
|
26
|
+
@endpoint = endpoint
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def endpoint
|
32
|
+
@endpoint || ENDPOINT
|
33
|
+
end
|
24
34
|
end
|
25
35
|
end
|
26
36
|
end
|