erorr 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/Gemfile.lock +2 -20
- data/erorr.gemspec +0 -1
- data/lib/erorr/cli.rb +2 -0
- data/lib/erorr/transport/http_async.rb +21 -4
- data/lib/erorr/version.rb +1 -1
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bac02e4b1328a39a8ab38697067259c3cb0429e5e7fb9085c343a0aa0ed963aa
|
4
|
+
data.tar.gz: cfbe5aaed5831f3e19344bd1c636b7947ba3b19dec07d0e52e1cf8a9056882ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 416f886c1bcf10eb555d094f592482e920a7a407c899bf91ceafdf9ce9bdbddc9c680811348d116c63e29d4b731cfa08d229309e7bf7697e6883a0273fd41679
|
7
|
+
data.tar.gz: 4a228f20669340c15ac5f4fe344e105be37095fa229a704f9702e1a68c8a8f2ed5e9301f15055ebde06275f40a9692a9ab65497bdfa5389fa16838136ce8cb2d
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,33 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
erorr (0.1.
|
4
|
+
erorr (0.1.2)
|
5
5
|
commander (~> 4.4)
|
6
6
|
concurrent-ruby (~> 1.0)
|
7
|
-
http
|
8
7
|
|
9
8
|
GEM
|
10
9
|
remote: https://rubygems.org/
|
11
10
|
specs:
|
12
|
-
addressable (2.6.0)
|
13
|
-
public_suffix (>= 2.0.2, < 4.0)
|
14
11
|
commander (4.4.7)
|
15
12
|
highline (~> 2.0.0)
|
16
|
-
concurrent-ruby (1.1.
|
13
|
+
concurrent-ruby (1.1.5)
|
17
14
|
diff-lcs (1.3)
|
18
|
-
domain_name (0.5.20180417)
|
19
|
-
unf (>= 0.0.5, < 1.0.0)
|
20
15
|
highline (2.0.1)
|
21
|
-
http (4.0.5)
|
22
|
-
addressable (~> 2.3)
|
23
|
-
http-cookie (~> 1.0)
|
24
|
-
http-form_data (~> 2.0)
|
25
|
-
http_parser.rb (~> 0.6.0)
|
26
|
-
http-cookie (1.0.3)
|
27
|
-
domain_name (~> 0.5)
|
28
|
-
http-form_data (2.1.1)
|
29
|
-
http_parser.rb (0.6.0)
|
30
|
-
public_suffix (3.0.3)
|
31
16
|
rake (10.5.0)
|
32
17
|
rspec (3.8.0)
|
33
18
|
rspec-core (~> 3.8.0)
|
@@ -42,9 +27,6 @@ GEM
|
|
42
27
|
diff-lcs (>= 1.2.0, < 2.0)
|
43
28
|
rspec-support (~> 3.8.0)
|
44
29
|
rspec-support (3.8.0)
|
45
|
-
unf (0.1.4)
|
46
|
-
unf_ext
|
47
|
-
unf_ext (0.0.7.5)
|
48
30
|
|
49
31
|
PLATFORMS
|
50
32
|
ruby
|
data/erorr.gemspec
CHANGED
data/lib/erorr/cli.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
require 'http'
|
1
|
+
require 'net/http'
|
2
|
+
require 'uri'
|
2
3
|
require 'concurrent'
|
3
4
|
|
4
5
|
module Erorr
|
@@ -9,10 +10,26 @@ module Erorr
|
|
9
10
|
@api_url = Erorr.config.api_url
|
10
11
|
end
|
11
12
|
|
13
|
+
class << self
|
14
|
+
def thread_pool
|
15
|
+
@thread_pool ||= Concurrent::ThreadPoolExecutor.new(max_threads: 5)
|
16
|
+
end
|
17
|
+
|
18
|
+
def shut_down
|
19
|
+
thread_pool.shutdown
|
20
|
+
thread_pool.wait_for_termination
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
12
24
|
def deliver(params)
|
13
|
-
|
14
|
-
|
15
|
-
|
25
|
+
self.class.thread_pool.post do
|
26
|
+
uri = URI("#{@api_url}/faults")
|
27
|
+
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
|
28
|
+
request.body = {fault: params, api_key: @api_key}.to_json
|
29
|
+
Net::HTTP.start(uri.hostname, uri.port) do |http|
|
30
|
+
http.request request
|
31
|
+
end
|
32
|
+
end
|
16
33
|
end
|
17
34
|
end
|
18
35
|
end
|
data/lib/erorr/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erorr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Georgi Mitrev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: http
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: concurrent-ruby
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -141,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
127
|
version: '0'
|
142
128
|
requirements: []
|
143
129
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.
|
130
|
+
rubygems_version: 2.7.6
|
145
131
|
signing_key:
|
146
132
|
specification_version: 4
|
147
133
|
summary: Ruby library for erorr.app
|