erorr 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/erorr/transport/http_async.rb +8 -7
- data/lib/erorr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cb405bc653a681b7390352189f883b9461524cff45b695e705acc9d20099696
|
4
|
+
data.tar.gz: 1a2f7c6706caa2468ca3ea72bdcbb0f44f3e332532356cbf7338dfaddf68cdde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ebfb0cc428b0d70dbf4fd92ab921b412fe627c4ed6772937f08fd43c11b4b390ec293980bcf1db5ba55ee971ac7f9e22c361b91a045461fe690d452b78a4612
|
7
|
+
data.tar.gz: b5ef9ec0e50d6eb6e7a2f6be7e8554d70eedfa6ed7f7c614491aeec3aab647d9ac9dbc8ec0e85cde11271c6f9c12bf95c0dcfb2c672df9ae8d2a15ca7a910adc
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'net/http'
|
2
|
+
require 'net/https'
|
2
3
|
require 'uri'
|
3
4
|
require 'concurrent'
|
4
5
|
|
@@ -22,16 +23,16 @@ module Erorr
|
|
22
23
|
end
|
23
24
|
|
24
25
|
def deliver(params)
|
25
|
-
puts 'Delivering shit...'
|
26
26
|
self.class.thread_pool.post do
|
27
|
-
puts 'Sending stuff'
|
28
27
|
uri = URI("#{@api_url}/faults")
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
post = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
|
29
|
+
post.body = {fault: params, api_key: @api_key}.to_json
|
30
|
+
|
31
|
+
request = Net::HTTP.new(uri.hostname, uri.port)
|
32
|
+
request.use_ssl = true
|
33
|
+
response = request.start do |http|
|
34
|
+
http.request post
|
33
35
|
end
|
34
|
-
puts "Response: #{response.inspect}"
|
35
36
|
end
|
36
37
|
end
|
37
38
|
end
|
data/lib/erorr/version.rb
CHANGED