rorvswild 1.5.4 → 1.5.5
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 +4 -4
- data/README.md +2 -2
- data/lib/rorvswild/client.rb +7 -2
- data/lib/rorvswild/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c48c5689b1cc41d4954efcf44a2c415ee4a803da60f6beb36424f9103d06d72e
|
|
4
|
+
data.tar.gz: 62da47461a2d4dc9e182aebe765d6dda46e188ea57687bcd8298e61acf8d51d6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e00fa04cd7566a8f64fe7d69ebc2a36acabec87619eee6e05ef2534ea429614a2be1ac7cd102b45440f5aa81333cdc6595f30b77c277ef7b7c2b832785ac48b8
|
|
7
|
+
data.tar.gz: 8e1b010d4057131da1178041640b095dea3f90c685f50d4f8c15fcda2ab0257c37cce986e72a5eca68154ecb39d78f1fd3e5912d2493f9a03400182b676563af
|
data/README.md
CHANGED
|
@@ -32,11 +32,11 @@ Signup on https://www.rorvswild.com and create an app to get one.
|
|
|
32
32
|
|
|
33
33
|
* Add in your Gemfile `gem "rorvswild"`
|
|
34
34
|
* Run `bundle install` in you terminal
|
|
35
|
-
* Run `rorvswild-
|
|
35
|
+
* Run `rorvswild-install API_KEY` in you terminal
|
|
36
36
|
* Deploy/Restart your app
|
|
37
37
|
* Make a few requests and refresh your app page on rorvswild.com to view the dashboard.
|
|
38
38
|
|
|
39
|
-
The `rorvswild-
|
|
39
|
+
The `rorvswild-install` command creates a `config/rorvswild.yml` file.
|
|
40
40
|
|
|
41
41
|
If you prefer to use an initializer, you can do the following:
|
|
42
42
|
|
data/lib/rorvswild/client.rb
CHANGED
|
@@ -21,12 +21,13 @@ module RorVsWild
|
|
|
21
21
|
@connection_count = 0
|
|
22
22
|
@mutex = Mutex.new
|
|
23
23
|
@config = config
|
|
24
|
+
@headers = {"Content-Type" => "application/json", "X-Gem-Version" => RorVsWild::VERSION}
|
|
25
|
+
@headers["X-Rails-Version"] = Rails.version if defined?(Rails)
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
def post(path, data)
|
|
27
29
|
uri = URI(api_url + path)
|
|
28
|
-
post = Net::HTTP::Post.new(uri.path,
|
|
29
|
-
post.content_type = "application/json".freeze
|
|
30
|
+
post = Net::HTTP::Post.new(uri.path, @headers)
|
|
30
31
|
post.basic_auth(nil, api_key)
|
|
31
32
|
post.body = data.to_json
|
|
32
33
|
transmit(post)
|
|
@@ -46,6 +47,7 @@ module RorVsWild
|
|
|
46
47
|
|
|
47
48
|
def take_or_create_connection
|
|
48
49
|
if http = take_connection
|
|
50
|
+
http.start unless http.active?
|
|
49
51
|
http
|
|
50
52
|
elsif @connection_count < max_connections
|
|
51
53
|
@connection_count += 1
|
|
@@ -57,6 +59,8 @@ module RorVsWild
|
|
|
57
59
|
if http = take_or_create_connection
|
|
58
60
|
http.request(request)
|
|
59
61
|
end
|
|
62
|
+
rescue Exception => ex
|
|
63
|
+
RorVsWild.logger.error(ex.full_message)
|
|
60
64
|
ensure
|
|
61
65
|
release_connection(http)
|
|
62
66
|
end
|
|
@@ -65,6 +69,7 @@ module RorVsWild
|
|
|
65
69
|
uri = URI(api_url)
|
|
66
70
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
67
71
|
http.open_timeout = timeout
|
|
72
|
+
http.keep_alive_timeout = 5
|
|
68
73
|
|
|
69
74
|
if uri.scheme == HTTPS
|
|
70
75
|
# Disable peer verification while there is a memory leak with OpenSSL
|
data/lib/rorvswild/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rorvswild
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.5.
|
|
4
|
+
version: 1.5.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexis Bernard
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-05-
|
|
11
|
+
date: 2020-05-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Performances and quality insights for rails developers.
|
|
14
14
|
email:
|