rorvswild 1.5.4 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 823ab7934d6f40bcf1e9cea8b11b67709fdf3291ee7f751c214bc326f27ffb57
4
- data.tar.gz: d886b176eeb69afc9c02e927cf783319d310e9854160aac9769ec0fb8fe4b0b3
3
+ metadata.gz: c48c5689b1cc41d4954efcf44a2c415ee4a803da60f6beb36424f9103d06d72e
4
+ data.tar.gz: 62da47461a2d4dc9e182aebe765d6dda46e188ea57687bcd8298e61acf8d51d6
5
5
  SHA512:
6
- metadata.gz: afc6de959ccc4f34dad4fd318c55a2bb55d844b66dfed98acada8c729f84cdad334f28394178ed90cc11582b95da94b35b101467bc0e6cda806cf14482814635
7
- data.tar.gz: c2a28c624fd45b76adc2b3718dc3994db0418166de4b3b40d51d5eb11f72f4a9405d9a752c6dac1f98a632cda0f632117387dea08fa4982aa524cbc38b1b91b0
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-setup API_KEY` in you terminal
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-setup` command creates a `config/rorvswild.yml` file.
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
 
@@ -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, "X-Gem-Version".freeze => RorVsWild::VERSION)
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
@@ -1,3 +1,3 @@
1
1
  module RorVsWild
2
- VERSION = "1.5.4".freeze
2
+ VERSION = "1.5.5".freeze
3
3
  end
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
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 00:00:00.000000000 Z
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: