uniara_virtual_parser 2.0.0 → 2.1.0

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: 140bdf23e8a5760457f283f6199883d581fb0283
4
- data.tar.gz: f1e892d201802957143cf86b725d53f493f12e67
3
+ metadata.gz: d608df32d169b7481d65450c2c39c4cf338dff6e
4
+ data.tar.gz: 5f4cace10867c2f5f48577c53e61fdde6c77e09d
5
5
  SHA512:
6
- metadata.gz: 95dacc28488ab96aa8f5cc4e657fd6a53041f2fde36db3fc0c099f4f9e260ef9d19665f7722ee24787bfb728ec634e07bb3fcc2c886f5d14a603641189786615
7
- data.tar.gz: 3aa1987f2e983094a9af49006ade5a180cd6470222c11d982f04e86de90593ad4b2cba2256bf99982b0859fbfd1b055adc6c2976599a5172588d5b8259de1a0b
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("#{ENDPOINT}#{path}")
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("#{ENDPOINT}#{path}")
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
@@ -1,3 +1,3 @@
1
1
  module UniaraVirtualParser
2
- VERSION = '2.0.0'
2
+ VERSION = '2.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uniara_virtual_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Ribeiro