sqreen 1.2.01484936161 → 1.3.01487852305

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
  SHA1:
3
- metadata.gz: f8b8e4c339703d78d76d87c9c00306ee5d658331
4
- data.tar.gz: fbe298fb99b526c9b1a8366347ce90b830529412
3
+ metadata.gz: a5b38201a0bb6e725b4756a87d69ec098ec6948e
4
+ data.tar.gz: 5e2d908ec523816f43e8acc92ac146c975642fce
5
5
  SHA512:
6
- metadata.gz: 6567012ee61a57b061758f1f680443c1a1808ab9a63f253ddbb4f58e33172462e1bb3c02d6741ee30c4d357508c24994916b97ab78191a06fde8ecb789623ecf
7
- data.tar.gz: 70f865c6df795c027b1c4225982904ae48b5b71cd94099cb066e80d7cd3d56277b5356b59dddbcb7d7649c2f6b66daacd6018929204809a37271635ec0184675
6
+ metadata.gz: 5d3f5bbe7fa33598ad38ad9eadf3d47cf6346bb3f95bc270a85ebf1d4f287ab82fa4655959fc379e1407c0a009df5773f2e81e769104b645cb7b9981e1e54b03
7
+ data.tar.gz: fd4a8048f4df1c070e3c8cfb8b79f5518ff7959a0bc867d4f6f215737e3806696028c4e12f6f7db43d081d045c1d32fb54d1f48b315719c1f3a8421a8d8b7eb0
@@ -3,6 +3,7 @@
3
3
  # Please refer to our terms for more information: https://www.sqreen.io/terms.html
4
4
 
5
5
  require 'sqreen/frameworks/generic'
6
+ require 'sqreen/middleware'
6
7
 
7
8
  module Sqreen
8
9
  module Frameworks
@@ -73,6 +74,7 @@ module Sqreen
73
74
  class Init < ::Rails::Railtie
74
75
  def self.startup
75
76
  initializer 'sqreen.startup' do |app|
77
+ app.middleware.insert_before(Rack::Runtime, Sqreen::Middleware)
76
78
  yield app
77
79
  end
78
80
  end
@@ -0,0 +1,14 @@
1
+ # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
+ # Please refer to our terms for more information: https://www.sqreen.io/terms.html
3
+
4
+ module Sqreen
5
+ class Middleware
6
+ def initialize(app)
7
+ @app = app
8
+ end
9
+
10
+ def call(env)
11
+ @app.call(env)
12
+ end
13
+ end
14
+ end
@@ -150,9 +150,9 @@ module Sqreen
150
150
  th = Thread.current
151
151
  return '' unless th
152
152
  re = th.to_s.scan(/:(0x.*)>/)
153
- return '' unless re && re.size > 0
153
+ return '' unless re && !re.empty?
154
154
  res = re[0]
155
- return '' unless res && res.size > 0
155
+ return '' unless res && !res.empty?
156
156
  res[0]
157
157
  end
158
158
 
@@ -230,17 +230,21 @@ module Sqreen
230
230
  return obj if max_depth < 0
231
231
  return rencode_array(obj, max_depth) if obj.is_a?(Array)
232
232
  return enforce_encoding(obj) unless obj.is_a?(Hash)
233
+ nobj = {}
233
234
  obj.each do |k, v|
234
- case v
235
- when Array
236
- obj[k] = rencode_array(v, max_depth)
237
- when Hash
238
- obj[k] = rencode_payload(v, max_depth)
239
- when String
240
- obj[k] = enforce_encoding(v)
241
- end
235
+ safe_k = rencode_payload(k, max_depth)
236
+ nobj[safe_k] = case v
237
+ when Array
238
+ rencode_array(v, max_depth)
239
+ when Hash
240
+ rencode_payload(v, max_depth)
241
+ when String
242
+ enforce_encoding(v)
243
+ else # for example integers
244
+ v
245
+ end
242
246
  end
243
- obj
247
+ nobj
244
248
  end
245
249
 
246
250
  def self.rencode_array(array, max_depth)
@@ -2,5 +2,5 @@
2
2
  # Please refer to our terms for more information: https://www.sqreen.io/terms.html
3
3
  # Warning This file is auto generated! DO NOT edit.
4
4
  module Sqreen
5
- VERSION = "1.2.01484936161".freeze
5
+ VERSION = "1.3.01487852305".freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqreen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.01484936161
4
+ version: 1.3.01487852305
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sqreen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-20 00:00:00.000000000 Z
11
+ date: 2017-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs
@@ -79,6 +79,7 @@ files:
79
79
  - lib/sqreen/metrics/collect.rb
80
80
  - lib/sqreen/metrics/sum.rb
81
81
  - lib/sqreen/metrics_store.rb
82
+ - lib/sqreen/middleware.rb
82
83
  - lib/sqreen/payload_creator.rb
83
84
  - lib/sqreen/performance_notifications.rb
84
85
  - lib/sqreen/performance_notifications/log.rb
@@ -131,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
132
  version: '0'
132
133
  requirements: []
133
134
  rubyforge_project:
134
- rubygems_version: 2.6.8
135
+ rubygems_version: 2.6.10
135
136
  signing_key:
136
137
  specification_version: 4
137
138
  summary: Sqreen Ruby agent