appsignal 0.8.11 → 0.8.12

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: 0ec48b20664d56b076ded5a3e0114f294a7c0623
4
- data.tar.gz: 6ec31090947b82fd5542665407e55bc8008ff464
3
+ metadata.gz: eba4ca3bafc6cb95c61c0135695eda9ada7a3128
4
+ data.tar.gz: 5e89621bb70dfb4cdadde2f996e5d4d83ecab9a6
5
5
  SHA512:
6
- metadata.gz: 90e7b37d11a139d19c946e457b053e0f5f475c1b404f6b0f467b25899ceb826cc67680d4ad62ea52b1324ec1e66303a94021ca960187c77dacb917e493bae710
7
- data.tar.gz: 13d1731f5513fc10d4cfc278969fbf57626b84b02a89a6c3b1e17dfa3b9cc5a0f7a3c8a35ee446fffd3b755c83311d2740c84fd0c611f78e1eda043615e6e8ac
6
+ metadata.gz: 113615a0525a2904cf5f6873032cc767bda1c842c1524383184dd722e27e3b01b41cda320b4497dd68d4119ff83303f43d55b169f8a3e58ff77f3d7be6d3b26a
7
+ data.tar.gz: ea517cd6039e98f8cc62f26e5d6e43ef4bf97a1c444f71309652354173874facc9a98075d97ba989235ee6e45624fe7048c5c341b0b286c70e131ebb3c5cd8ee
@@ -1,3 +1,7 @@
1
+ # 0.8.12
2
+ * Workaround for frozen string in Notification events
3
+ * Require ActiveSupport::Notifications to be sure it's available
4
+
1
5
  # 0.8.11
2
6
  * Skip enqueue, send_exception and add_exception if not active
3
7
 
@@ -3,6 +3,7 @@ require 'rack'
3
3
  require 'thread_safe'
4
4
  require 'securerandom'
5
5
  require 'active_support/json'
6
+ require 'active_support/notifications'
6
7
 
7
8
  module Appsignal
8
9
  class << self
@@ -8,7 +8,7 @@ module Appsignal
8
8
  if event.name.end_with?(TARGET_EVENT_CATEGORY)
9
9
  identifier = event.payload[:identifier]
10
10
  if identifier
11
- identifier.gsub!(root_path, '')
11
+ event.payload[:identifier] = identifier.gsub(root_path, '')
12
12
  end
13
13
  end
14
14
  yield
@@ -16,7 +16,7 @@ module Appsignal
16
16
  def call(event)
17
17
  if event.name == TARGET_EVENT_NAME
18
18
  unless schema_query?(event) || adapter_uses_prepared_statements?
19
- query_string = event.payload[:sql]
19
+ query_string = event.payload[:sql].dup
20
20
  if query_string
21
21
  if adapter_uses_double_quoted_table_names?
22
22
  query_string.gsub!(SINGLE_QUOTE, SANITIZED_VALUE)
@@ -28,6 +28,7 @@ module Appsignal
28
28
  end
29
29
  query_string.gsub!(IN_ARRAY, SANITIZED_VALUE)
30
30
  query_string.gsub!(NUMERIC_DATA, SANITIZED_VALUE)
31
+ event.payload[:sql] = query_string
31
32
  end
32
33
  end
33
34
  event.payload.delete(:connection_id)
@@ -1,3 +1,3 @@
1
1
  module Appsignal
2
- VERSION = '0.8.11'
2
+ VERSION = '0.8.12'
3
3
  end
@@ -25,7 +25,19 @@ if rails_present?
25
25
  before { sanitizer.call(event) { } }
26
26
 
27
27
  it "should strip Rails root from the path" do
28
- payload[:identifier].should == 'app/views/home/index/html.erb'
28
+ subject[:identifier].should == 'app/views/home/index/html.erb'
29
+ end
30
+
31
+ context "with a frozen identifier" do
32
+ let(:payload) do
33
+ {
34
+ :identifier => '/var/www/app/20130101/app/views/home/index/html.erb'.freeze
35
+ }
36
+ end
37
+
38
+ it "should strip Rails root from the path" do
39
+ subject[:identifier].should == 'app/views/home/index/html.erb'
40
+ end
29
41
  end
30
42
  end
31
43
  end
@@ -142,6 +142,12 @@ if rails_present?
142
142
 
143
143
  it { should == 'SET client_min_messages TO 22' }
144
144
  end
145
+
146
+ context "with a a frozen sql string" do
147
+ let(:sql) { "SELECT `table`.* FROM `table` WHERE `id` = 'secret'".freeze }
148
+
149
+ it { should == "SELECT `table`.* FROM `table` WHERE `id` = ?" }
150
+ end
145
151
  end
146
152
 
147
153
  describe "#schema_query?" do
@@ -396,9 +396,8 @@ describe Appsignal do
396
396
  context "without agent" do
397
397
  let(:agent) { nil }
398
398
 
399
- it "should not change paused state on agent" do
400
- agent.should_not_receive(:paused=).with(true)
401
- agent.should_not_receive(:paused=).with(false)
399
+ it "should not crash" do
400
+ # just execute the after block
402
401
  end
403
402
  end
404
403
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.11
4
+ version: 0.8.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-05-08 00:00:00.000000000 Z
15
+ date: 2014-05-26 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport