appsignal 2.11.3-java → 2.11.4-java
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/.rubocop.yml +2 -0
- data/CHANGELOG.md +5 -0
- data/Rakefile +9 -6
- data/lib/appsignal/integrations/object.rb +4 -34
- data/lib/appsignal/integrations/object_ruby_19.rb +37 -0
- data/lib/appsignal/integrations/object_ruby_modern.rb +64 -0
- data/lib/appsignal/system.rb +4 -0
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/integrations/object_19_spec.rb +266 -0
- data/spec/lib/appsignal/integrations/object_spec.rb +29 -10
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2437240f8298f3750115f38e730027652c282e9f259c651bd8111c3ca155bbd7
|
4
|
+
data.tar.gz: 0b0e58c57c07ea20524c4f40a57ad3390834707e6f5319a20559b8285ff7d550
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e803aadead924e985168c693f8aaa7bd160febbd3bf371d5e4ea507449ce5e4ad2ce19be526ce56b118d39959b11cbdbadeb535e576f9a075b249be946999fa
|
7
|
+
data.tar.gz: fa3192e852d1e6e77ab137c18d3c75ca2b67cd751d0de97cc1bacc8512e49eb76a2c01100a232c0dc6de1fd67a91b05f56d0a236104edab7321d44a110b47f4f
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -275,7 +275,8 @@ namespace :publish do
|
|
275
275
|
Dir.chdir("#{File.dirname(__FILE__)}/pkg") do
|
276
276
|
Dir["*.gem"].each do |gem_package|
|
277
277
|
puts "## Publishing gem package: #{gem_package}"
|
278
|
-
system "gem push #{gem_package}"
|
278
|
+
result = system "gem push #{gem_package}"
|
279
|
+
raise "Failed to Push gem" unless result
|
279
280
|
end
|
280
281
|
end
|
281
282
|
end
|
@@ -374,19 +375,21 @@ end
|
|
374
375
|
begin
|
375
376
|
require "rspec/core/rake_task"
|
376
377
|
is_jruby = defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
|
377
|
-
|
378
|
-
|
379
|
-
|
378
|
+
excludes = []
|
379
|
+
excludes << "spec/lib/appsignal/extension/jruby_spec.rb" unless is_jruby
|
380
|
+
is_ruby19 = RUBY_VERSION < "2.0"
|
381
|
+
excludes << "spec/lib/appsignal/integrations/object_spec.rb" if is_ruby19
|
382
|
+
exclude_pattern = "--exclude-pattern=#{excludes.join(",")}" if excludes.any?
|
380
383
|
|
381
384
|
desc "Run the AppSignal gem test suite."
|
382
385
|
RSpec::Core::RakeTask.new :test do |t|
|
383
|
-
t.rspec_opts =
|
386
|
+
t.rspec_opts = exclude_pattern
|
384
387
|
end
|
385
388
|
|
386
389
|
namespace :test do
|
387
390
|
desc "Run the Appsignal gem test in an extension failure scenario"
|
388
391
|
RSpec::Core::RakeTask.new :failure do |t|
|
389
|
-
t.rspec_opts = "#{
|
392
|
+
t.rspec_opts = "#{exclude_pattern} --tag extension_installation_failure"
|
390
393
|
end
|
391
394
|
end
|
392
395
|
rescue LoadError # rubocop:disable Lint/HandleExceptions
|
@@ -4,38 +4,8 @@ if defined?(Appsignal)
|
|
4
4
|
Appsignal::Environment.report_enabled("object_instrumentation")
|
5
5
|
end
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
singleton_class.send(:define_method, method_name) do |*args, &block|
|
12
|
-
name = options.fetch(:name) do
|
13
|
-
"#{method_name}.class_method.#{appsignal_reverse_class_name}.other"
|
14
|
-
end
|
15
|
-
Appsignal.instrument name do
|
16
|
-
send "appsignal_uninstrumented_#{method_name}", *args, &block
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.appsignal_instrument_method(method_name, options = {})
|
22
|
-
alias_method "appsignal_uninstrumented_#{method_name}", method_name
|
23
|
-
define_method method_name do |*args, &block|
|
24
|
-
name = options.fetch(:name) do
|
25
|
-
"#{method_name}.#{appsignal_reverse_class_name}.other"
|
26
|
-
end
|
27
|
-
Appsignal.instrument name do
|
28
|
-
send "appsignal_uninstrumented_#{method_name}", *args, &block
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def self.appsignal_reverse_class_name
|
34
|
-
return "AnonymousClass" unless name
|
35
|
-
name.split("::").reverse.join(".")
|
36
|
-
end
|
37
|
-
|
38
|
-
def appsignal_reverse_class_name
|
39
|
-
self.class.appsignal_reverse_class_name
|
40
|
-
end
|
7
|
+
if RUBY_VERSION < "2.0"
|
8
|
+
require "appsignal/integrations/object_ruby_19"
|
9
|
+
else
|
10
|
+
require "appsignal/integrations/object_ruby_modern"
|
41
11
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Object
|
4
|
+
def self.appsignal_instrument_class_method(method_name, options = {})
|
5
|
+
singleton_class.send \
|
6
|
+
:alias_method, "appsignal_uninstrumented_#{method_name}", method_name
|
7
|
+
singleton_class.send(:define_method, method_name) do |*args, &block|
|
8
|
+
name = options.fetch(:name) do
|
9
|
+
"#{method_name}.class_method.#{appsignal_reverse_class_name}.other"
|
10
|
+
end
|
11
|
+
Appsignal.instrument name do
|
12
|
+
send "appsignal_uninstrumented_#{method_name}", *args, &block
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.appsignal_instrument_method(method_name, options = {})
|
18
|
+
alias_method "appsignal_uninstrumented_#{method_name}", method_name
|
19
|
+
define_method method_name do |*args, &block|
|
20
|
+
name = options.fetch(:name) do
|
21
|
+
"#{method_name}.#{appsignal_reverse_class_name}.other"
|
22
|
+
end
|
23
|
+
Appsignal.instrument name do
|
24
|
+
send "appsignal_uninstrumented_#{method_name}", *args, &block
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.appsignal_reverse_class_name
|
30
|
+
return "AnonymousClass" unless name
|
31
|
+
name.split("::").reverse.join(".")
|
32
|
+
end
|
33
|
+
|
34
|
+
def appsignal_reverse_class_name
|
35
|
+
self.class.appsignal_reverse_class_name
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Object
|
4
|
+
if Appsignal::System.ruby_2_7_or_newer?
|
5
|
+
def self.appsignal_instrument_class_method(method_name, options = {})
|
6
|
+
singleton_class.send \
|
7
|
+
:alias_method, "appsignal_uninstrumented_#{method_name}", method_name
|
8
|
+
singleton_class.send(:define_method, method_name) do |*args, **kwargs, &block|
|
9
|
+
name = options.fetch(:name) do
|
10
|
+
"#{method_name}.class_method.#{appsignal_reverse_class_name}.other"
|
11
|
+
end
|
12
|
+
Appsignal.instrument name do
|
13
|
+
send "appsignal_uninstrumented_#{method_name}", *args, **kwargs, &block
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.appsignal_instrument_method(method_name, options = {})
|
19
|
+
alias_method "appsignal_uninstrumented_#{method_name}", method_name
|
20
|
+
define_method method_name do |*args, **kwargs, &block|
|
21
|
+
name = options.fetch(:name) do
|
22
|
+
"#{method_name}.#{appsignal_reverse_class_name}.other"
|
23
|
+
end
|
24
|
+
Appsignal.instrument name do
|
25
|
+
send "appsignal_uninstrumented_#{method_name}", *args, **kwargs, &block
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
else
|
30
|
+
def self.appsignal_instrument_class_method(method_name, options = {})
|
31
|
+
singleton_class.send \
|
32
|
+
:alias_method, "appsignal_uninstrumented_#{method_name}", method_name
|
33
|
+
singleton_class.send(:define_method, method_name) do |*args, &block|
|
34
|
+
name = options.fetch(:name) do
|
35
|
+
"#{method_name}.class_method.#{appsignal_reverse_class_name}.other"
|
36
|
+
end
|
37
|
+
Appsignal.instrument name do
|
38
|
+
send "appsignal_uninstrumented_#{method_name}", *args, &block
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.appsignal_instrument_method(method_name, options = {})
|
44
|
+
alias_method "appsignal_uninstrumented_#{method_name}", method_name
|
45
|
+
define_method method_name do |*args, &block|
|
46
|
+
name = options.fetch(:name) do
|
47
|
+
"#{method_name}.#{appsignal_reverse_class_name}.other"
|
48
|
+
end
|
49
|
+
Appsignal.instrument name do
|
50
|
+
send "appsignal_uninstrumented_#{method_name}", *args, &block
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.appsignal_reverse_class_name
|
57
|
+
return "AnonymousClass" unless name
|
58
|
+
name.split("::").reverse.join(".")
|
59
|
+
end
|
60
|
+
|
61
|
+
def appsignal_reverse_class_name
|
62
|
+
self.class.appsignal_reverse_class_name
|
63
|
+
end
|
64
|
+
end
|
data/lib/appsignal/system.rb
CHANGED
data/lib/appsignal/version.rb
CHANGED
@@ -0,0 +1,266 @@
|
|
1
|
+
require "appsignal/integrations/object"
|
2
|
+
|
3
|
+
def is_ruby_19
|
4
|
+
RUBY_VERSION < "2.0"
|
5
|
+
end
|
6
|
+
|
7
|
+
describe Object do
|
8
|
+
describe "#instrument_method" do
|
9
|
+
context "with instance method" do
|
10
|
+
let(:klass) do
|
11
|
+
Class.new do
|
12
|
+
def foo(param1, options = {})
|
13
|
+
[param1, options]
|
14
|
+
end
|
15
|
+
appsignal_instrument_method :foo
|
16
|
+
end
|
17
|
+
end
|
18
|
+
let(:instance) { klass.new }
|
19
|
+
|
20
|
+
def call_with_arguments
|
21
|
+
instance.foo(
|
22
|
+
"abc",
|
23
|
+
:foo => "bar"
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
context "when active" do
|
28
|
+
let(:transaction) { http_request_transaction }
|
29
|
+
before do
|
30
|
+
Appsignal.config = project_fixture_config
|
31
|
+
expect(Appsignal::Transaction).to receive(:current).at_least(:once).and_return(transaction)
|
32
|
+
end
|
33
|
+
after { Appsignal.config = nil }
|
34
|
+
|
35
|
+
context "with anonymous class" do
|
36
|
+
it "instruments the method and calls it" do
|
37
|
+
expect(Appsignal.active?).to be_truthy
|
38
|
+
expect(transaction).to receive(:start_event)
|
39
|
+
expect(transaction).to receive(:finish_event).with \
|
40
|
+
"foo.AnonymousClass.other", nil, nil, Appsignal::EventFormatter::DEFAULT
|
41
|
+
expect(call_with_arguments).to eq(["abc", { :foo => "bar" }])
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
context "with named class" do
|
46
|
+
before do
|
47
|
+
class NamedClass
|
48
|
+
def foo
|
49
|
+
1
|
50
|
+
end
|
51
|
+
appsignal_instrument_method :foo
|
52
|
+
end
|
53
|
+
end
|
54
|
+
after { Object.send(:remove_const, :NamedClass) }
|
55
|
+
let(:klass) { NamedClass }
|
56
|
+
|
57
|
+
it "instruments the method and calls it" do
|
58
|
+
expect(Appsignal.active?).to be_truthy
|
59
|
+
expect(transaction).to receive(:start_event)
|
60
|
+
expect(transaction).to receive(:finish_event).with \
|
61
|
+
"foo.NamedClass.other", nil, nil, Appsignal::EventFormatter::DEFAULT
|
62
|
+
expect(instance.foo).to eq(1)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
context "with nested named class" do
|
67
|
+
before do
|
68
|
+
module MyModule
|
69
|
+
module NestedModule
|
70
|
+
class NamedClass
|
71
|
+
def bar
|
72
|
+
2
|
73
|
+
end
|
74
|
+
appsignal_instrument_method :bar
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
after { Object.send(:remove_const, :MyModule) }
|
80
|
+
let(:klass) { MyModule::NestedModule::NamedClass }
|
81
|
+
|
82
|
+
it "instruments the method and calls it" do
|
83
|
+
expect(Appsignal.active?).to be_truthy
|
84
|
+
expect(transaction).to receive(:start_event)
|
85
|
+
expect(transaction).to receive(:finish_event).with \
|
86
|
+
"bar.NamedClass.NestedModule.MyModule.other", nil, nil,
|
87
|
+
Appsignal::EventFormatter::DEFAULT
|
88
|
+
expect(instance.bar).to eq(2)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
context "with custom name" do
|
93
|
+
let(:klass) do
|
94
|
+
Class.new do
|
95
|
+
def foo
|
96
|
+
1
|
97
|
+
end
|
98
|
+
appsignal_instrument_method :foo, :name => "my_method.group"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
it "instruments with custom name" do
|
103
|
+
expect(Appsignal.active?).to be_truthy
|
104
|
+
expect(transaction).to receive(:start_event)
|
105
|
+
expect(transaction).to receive(:finish_event).with \
|
106
|
+
"my_method.group", nil, nil, Appsignal::EventFormatter::DEFAULT
|
107
|
+
expect(instance.foo).to eq(1)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
context "with a method given a block" do
|
112
|
+
let(:klass) do
|
113
|
+
Class.new do
|
114
|
+
def foo
|
115
|
+
yield
|
116
|
+
end
|
117
|
+
appsignal_instrument_method :foo
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should yield the block" do
|
122
|
+
expect(instance.foo { 42 }).to eq(42)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
context "when not active" do
|
128
|
+
let(:transaction) { Appsignal::Transaction.current }
|
129
|
+
|
130
|
+
it "does not instrument, but still calls the method" do
|
131
|
+
expect(Appsignal.active?).to be_falsy
|
132
|
+
expect(transaction).to_not receive(:start_event)
|
133
|
+
expect(call_with_arguments).to eq(["abc", { :foo => "bar" }])
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
context "with class method" do
|
139
|
+
let(:klass) do
|
140
|
+
Class.new do
|
141
|
+
def self.bar(param1, options = {})
|
142
|
+
[param1, options]
|
143
|
+
end
|
144
|
+
appsignal_instrument_class_method :bar
|
145
|
+
end
|
146
|
+
end
|
147
|
+
def call_with_arguments
|
148
|
+
klass.bar(
|
149
|
+
"abc",
|
150
|
+
:foo => "bar"
|
151
|
+
)
|
152
|
+
end
|
153
|
+
|
154
|
+
context "when active" do
|
155
|
+
let(:transaction) { http_request_transaction }
|
156
|
+
before do
|
157
|
+
Appsignal.config = project_fixture_config
|
158
|
+
expect(Appsignal::Transaction).to receive(:current).at_least(:once)
|
159
|
+
.and_return(transaction)
|
160
|
+
end
|
161
|
+
after { Appsignal.config = nil }
|
162
|
+
|
163
|
+
context "with anonymous class" do
|
164
|
+
it "instruments the method and calls it" do
|
165
|
+
expect(Appsignal.active?).to be_truthy
|
166
|
+
expect(transaction).to receive(:start_event)
|
167
|
+
expect(transaction).to receive(:finish_event).with \
|
168
|
+
"bar.class_method.AnonymousClass.other", nil, nil, Appsignal::EventFormatter::DEFAULT
|
169
|
+
expect(call_with_arguments).to eq(["abc", { :foo => "bar" }])
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
context "with named class" do
|
174
|
+
before do
|
175
|
+
class NamedClass
|
176
|
+
def self.bar
|
177
|
+
2
|
178
|
+
end
|
179
|
+
appsignal_instrument_class_method :bar
|
180
|
+
end
|
181
|
+
end
|
182
|
+
after { Object.send(:remove_const, :NamedClass) }
|
183
|
+
let(:klass) { NamedClass }
|
184
|
+
|
185
|
+
it "instruments the method and calls it" do
|
186
|
+
expect(Appsignal.active?).to be_truthy
|
187
|
+
expect(transaction).to receive(:start_event)
|
188
|
+
expect(transaction).to receive(:finish_event).with \
|
189
|
+
"bar.class_method.NamedClass.other", nil, nil, Appsignal::EventFormatter::DEFAULT
|
190
|
+
expect(klass.bar).to eq(2)
|
191
|
+
end
|
192
|
+
|
193
|
+
context "with nested named class" do
|
194
|
+
before do
|
195
|
+
module MyModule
|
196
|
+
module NestedModule
|
197
|
+
class NamedClass
|
198
|
+
def self.bar
|
199
|
+
2
|
200
|
+
end
|
201
|
+
appsignal_instrument_class_method :bar
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
after { Object.send(:remove_const, :MyModule) }
|
207
|
+
let(:klass) { MyModule::NestedModule::NamedClass }
|
208
|
+
|
209
|
+
it "instruments the method and calls it" do
|
210
|
+
expect(Appsignal.active?).to be_truthy
|
211
|
+
expect(transaction).to receive(:start_event)
|
212
|
+
expect(transaction).to receive(:finish_event).with \
|
213
|
+
"bar.class_method.NamedClass.NestedModule.MyModule.other", nil, nil,
|
214
|
+
Appsignal::EventFormatter::DEFAULT
|
215
|
+
expect(klass.bar).to eq(2)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
context "with custom name" do
|
221
|
+
let(:klass) do
|
222
|
+
Class.new do
|
223
|
+
def self.bar
|
224
|
+
2
|
225
|
+
end
|
226
|
+
appsignal_instrument_class_method :bar, :name => "my_method.group"
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
it "instruments with custom name" do
|
231
|
+
expect(Appsignal.active?).to be_truthy
|
232
|
+
expect(transaction).to receive(:start_event)
|
233
|
+
expect(transaction).to receive(:finish_event).with \
|
234
|
+
"my_method.group", nil, nil, Appsignal::EventFormatter::DEFAULT
|
235
|
+
expect(klass.bar).to eq(2)
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
context "with a method given a block" do
|
240
|
+
let(:klass) do
|
241
|
+
Class.new do
|
242
|
+
def self.bar
|
243
|
+
yield
|
244
|
+
end
|
245
|
+
appsignal_instrument_class_method :bar
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
it "should yield the block" do
|
250
|
+
expect(klass.bar { 42 }).to eq(42)
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
context "when not active" do
|
256
|
+
let(:transaction) { Appsignal::Transaction.current }
|
257
|
+
|
258
|
+
it "does not instrument, but still call the method" do
|
259
|
+
expect(Appsignal.active?).to be_falsy
|
260
|
+
expect(transaction).to_not receive(:start_event)
|
261
|
+
expect(call_with_arguments).to eq(["abc", { :foo => "bar" }])
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
@@ -1,18 +1,30 @@
|
|
1
1
|
require "appsignal/integrations/object"
|
2
2
|
|
3
|
+
def is_ruby_19
|
4
|
+
RUBY_VERSION < "2.0"
|
5
|
+
end
|
6
|
+
|
3
7
|
describe Object do
|
4
8
|
describe "#instrument_method" do
|
5
9
|
context "with instance method" do
|
6
10
|
let(:klass) do
|
7
11
|
Class.new do
|
8
|
-
def foo
|
9
|
-
|
12
|
+
def foo(param1, options = {}, keyword_param: 1)
|
13
|
+
[param1, options, keyword_param]
|
10
14
|
end
|
11
15
|
appsignal_instrument_method :foo
|
12
16
|
end
|
13
17
|
end
|
14
18
|
let(:instance) { klass.new }
|
15
19
|
|
20
|
+
def call_with_arguments
|
21
|
+
instance.foo(
|
22
|
+
"abc",
|
23
|
+
{ :foo => "bar" },
|
24
|
+
:keyword_param => 2
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
16
28
|
context "when active" do
|
17
29
|
let(:transaction) { http_request_transaction }
|
18
30
|
before do
|
@@ -27,7 +39,7 @@ describe Object do
|
|
27
39
|
expect(transaction).to receive(:start_event)
|
28
40
|
expect(transaction).to receive(:finish_event).with \
|
29
41
|
"foo.AnonymousClass.other", nil, nil, Appsignal::EventFormatter::DEFAULT
|
30
|
-
expect(
|
42
|
+
expect(call_with_arguments).to eq(["abc", { :foo => "bar" }, 2])
|
31
43
|
end
|
32
44
|
end
|
33
45
|
|
@@ -116,10 +128,10 @@ describe Object do
|
|
116
128
|
context "when not active" do
|
117
129
|
let(:transaction) { Appsignal::Transaction.current }
|
118
130
|
|
119
|
-
it "
|
131
|
+
it "does not instrument, but still calls the method" do
|
120
132
|
expect(Appsignal.active?).to be_falsy
|
121
133
|
expect(transaction).to_not receive(:start_event)
|
122
|
-
expect(
|
134
|
+
expect(call_with_arguments).to eq(["abc", { :foo => "bar" }, 2])
|
123
135
|
end
|
124
136
|
end
|
125
137
|
end
|
@@ -127,12 +139,19 @@ describe Object do
|
|
127
139
|
context "with class method" do
|
128
140
|
let(:klass) do
|
129
141
|
Class.new do
|
130
|
-
def self.bar
|
131
|
-
|
142
|
+
def self.bar(param1, options = {}, keyword_param: 1)
|
143
|
+
[param1, options, keyword_param]
|
132
144
|
end
|
133
145
|
appsignal_instrument_class_method :bar
|
134
146
|
end
|
135
147
|
end
|
148
|
+
def call_with_arguments
|
149
|
+
klass.bar(
|
150
|
+
"abc",
|
151
|
+
{ :foo => "bar" },
|
152
|
+
:keyword_param => 2
|
153
|
+
)
|
154
|
+
end
|
136
155
|
|
137
156
|
context "when active" do
|
138
157
|
let(:transaction) { http_request_transaction }
|
@@ -149,7 +168,7 @@ describe Object do
|
|
149
168
|
expect(transaction).to receive(:start_event)
|
150
169
|
expect(transaction).to receive(:finish_event).with \
|
151
170
|
"bar.class_method.AnonymousClass.other", nil, nil, Appsignal::EventFormatter::DEFAULT
|
152
|
-
expect(
|
171
|
+
expect(call_with_arguments).to eq(["abc", { :foo => "bar" }, 2])
|
153
172
|
end
|
154
173
|
end
|
155
174
|
|
@@ -238,10 +257,10 @@ describe Object do
|
|
238
257
|
context "when not active" do
|
239
258
|
let(:transaction) { Appsignal::Transaction.current }
|
240
259
|
|
241
|
-
it "
|
260
|
+
it "does not instrument, but still call the method" do
|
242
261
|
expect(Appsignal.active?).to be_falsy
|
243
262
|
expect(transaction).to_not receive(:start_event)
|
244
|
-
expect(
|
263
|
+
expect(call_with_arguments).to eq(["abc", { :foo => "bar" }, 2])
|
245
264
|
end
|
246
265
|
end
|
247
266
|
end
|
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: 2.11.
|
4
|
+
version: 2.11.4
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-01-
|
13
|
+
date: 2021-01-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
@@ -247,6 +247,8 @@ files:
|
|
247
247
|
- lib/appsignal/integrations/grape.rb
|
248
248
|
- lib/appsignal/integrations/mongo_ruby_driver.rb
|
249
249
|
- lib/appsignal/integrations/object.rb
|
250
|
+
- lib/appsignal/integrations/object_ruby_19.rb
|
251
|
+
- lib/appsignal/integrations/object_ruby_modern.rb
|
250
252
|
- lib/appsignal/integrations/padrino.rb
|
251
253
|
- lib/appsignal/integrations/que.rb
|
252
254
|
- lib/appsignal/integrations/railtie.rb
|
@@ -336,6 +338,7 @@ files:
|
|
336
338
|
- spec/lib/appsignal/integrations/data_mapper_spec.rb
|
337
339
|
- spec/lib/appsignal/integrations/grape_spec.rb
|
338
340
|
- spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb
|
341
|
+
- spec/lib/appsignal/integrations/object_19_spec.rb
|
339
342
|
- spec/lib/appsignal/integrations/object_spec.rb
|
340
343
|
- spec/lib/appsignal/integrations/padrino_spec.rb
|
341
344
|
- spec/lib/appsignal/integrations/que_spec.rb
|
@@ -429,7 +432,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
429
432
|
- !ruby/object:Gem::Version
|
430
433
|
version: '0'
|
431
434
|
requirements: []
|
432
|
-
rubygems_version: 3.2.
|
435
|
+
rubygems_version: 3.2.6
|
433
436
|
signing_key:
|
434
437
|
specification_version: 4
|
435
438
|
summary: Logs performance and exception data from your app to appsignal.com
|
@@ -488,6 +491,7 @@ test_files:
|
|
488
491
|
- spec/lib/appsignal/integrations/data_mapper_spec.rb
|
489
492
|
- spec/lib/appsignal/integrations/grape_spec.rb
|
490
493
|
- spec/lib/appsignal/integrations/mongo_ruby_driver_spec.rb
|
494
|
+
- spec/lib/appsignal/integrations/object_19_spec.rb
|
491
495
|
- spec/lib/appsignal/integrations/object_spec.rb
|
492
496
|
- spec/lib/appsignal/integrations/padrino_spec.rb
|
493
497
|
- spec/lib/appsignal/integrations/que_spec.rb
|