appsignal 2.10.4 → 2.10.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semaphore/semaphore.yml +154 -2
- data/CHANGELOG.md +19 -0
- data/Rakefile +7 -1
- data/appsignal.gemspec +5 -2
- data/build_matrix.yml +17 -2
- data/ext/agent.yml +19 -19
- data/ext/base.rb +4 -2
- data/lib/appsignal.rb +6 -3
- data/lib/appsignal/cli/diagnose.rb +1 -1
- data/lib/appsignal/cli/notify_of_deploy.rb +1 -1
- data/lib/appsignal/event_formatter.rb +1 -2
- data/lib/appsignal/integrations/delayed_job_plugin.rb +16 -3
- data/lib/appsignal/integrations/grape.rb +2 -1
- data/lib/appsignal/minutely.rb +1 -2
- data/lib/appsignal/rack/js_exception_catcher.rb +3 -4
- data/lib/appsignal/transaction.rb +6 -1
- data/lib/appsignal/utils/deprecation_message.rb +2 -2
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/auth_check_spec.rb +1 -1
- data/spec/lib/appsignal/cli/diagnose_spec.rb +1 -1
- data/spec/lib/appsignal/cli/notify_of_deploy_spec.rb +4 -2
- data/spec/lib/appsignal/config_spec.rb +7 -7
- data/spec/lib/appsignal/event_formatter_spec.rb +5 -4
- data/spec/lib/appsignal/hooks/delayed_job_spec.rb +198 -166
- data/spec/lib/appsignal/integrations/grape_spec.rb +10 -0
- data/spec/lib/appsignal/minutely_spec.rb +4 -4
- data/spec/lib/appsignal/rack/js_exception_catcher_spec.rb +9 -5
- data/spec/lib/appsignal/transaction_spec.rb +14 -1
- data/spec/lib/appsignal/transmitter_spec.rb +3 -1
- data/spec/lib/appsignal_spec.rb +2 -2
- data/spec/spec_helper.rb +15 -1
- data/support/install_deps +4 -1
- metadata +21 -21
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 2.10.8
|
4
|
+
- Fix failed checksum error log. PR #609
|
5
|
+
- Fix DelayedJob action name detection for objects that listen to the `[]`
|
6
|
+
method and return a non-String value. #611
|
7
|
+
- CI test build improvements. PR #607, #608, #614
|
8
|
+
|
9
|
+
## 2.10.7
|
10
|
+
- Revert fix for compatibility with the `http_logger` gem. PR #604.
|
11
|
+
For more information, see issue #603 about our reasoning and discussion.
|
12
|
+
|
13
|
+
## 2.10.6
|
14
|
+
- Check if queued payloads are for correct app and not expired
|
15
|
+
|
16
|
+
## 2.10.5
|
17
|
+
- Improve Ruby 1.9 compatibility. PR #591
|
18
|
+
- Add grape.skip_appsignal_error request env. PR #588
|
19
|
+
More information: https://docs.appsignal.com/ruby/integrations/grape.html
|
20
|
+
- Fix compatibility with the `http_logger` gem. Fix `SystemStackError`. PR #597
|
21
|
+
|
3
22
|
## 2.10.4
|
4
23
|
- Fix `Appsignal::Transaction#set_http_or_background_action` helper (used by
|
5
24
|
`Appsignal.monitor_transaction`), to allow overwriting the action name of a
|
data/Rakefile
CHANGED
@@ -59,6 +59,7 @@ namespace :build_matrix do
|
|
59
59
|
|
60
60
|
env = [
|
61
61
|
env_map("RUBY_VERSION", ruby_version),
|
62
|
+
env_map("GEMSET", gem["gem"]),
|
62
63
|
env_map("BUNDLE_GEMFILE", "gemfiles/#{gem["gem"]}.gemfile")
|
63
64
|
]
|
64
65
|
rubygems = gem["rubygems"] || ruby["rubygems"] || defaults["rubygems"]
|
@@ -364,7 +365,12 @@ end
|
|
364
365
|
begin
|
365
366
|
require "rspec/core/rake_task"
|
366
367
|
desc "Run the AppSignal gem test suite."
|
367
|
-
RSpec::Core::RakeTask.new :test
|
368
|
+
RSpec::Core::RakeTask.new :test do |t|
|
369
|
+
is_jruby = defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
|
370
|
+
unless is_jruby
|
371
|
+
t.rspec_opts = "--exclude-pattern=spec/lib/appsignal/extension/jruby_spec.rb"
|
372
|
+
end
|
373
|
+
end
|
368
374
|
rescue LoadError # rubocop:disable Lint/HandleExceptions
|
369
375
|
# When running rake install, there is no RSpec yet.
|
370
376
|
end
|
data/appsignal.gemspec
CHANGED
@@ -39,9 +39,12 @@ Gem::Specification.new do |gem| # rubocop:disable Metrics/BlockLength
|
|
39
39
|
|
40
40
|
gem.add_development_dependency "rake", "~> 11"
|
41
41
|
gem.add_development_dependency "rspec", "~> 3.8"
|
42
|
-
gem.add_development_dependency "pry"
|
43
42
|
gem.add_development_dependency "timecop"
|
44
43
|
gem.add_development_dependency "webmock"
|
45
|
-
gem.add_development_dependency "rubocop", "0.50.0"
|
46
44
|
gem.add_development_dependency "yard", ">= 0.9.20"
|
45
|
+
is_modern_ruby = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.0.0")
|
46
|
+
if is_modern_ruby
|
47
|
+
gem.add_development_dependency "pry"
|
48
|
+
gem.add_development_dependency "rubocop", "0.50.0"
|
49
|
+
end
|
47
50
|
end
|
data/build_matrix.yml
CHANGED
@@ -34,15 +34,20 @@ semaphore: # Default `.semaphore/semaphore.yml` contents
|
|
34
34
|
- checkout
|
35
35
|
- sem-version ruby $RUBY_VERSION
|
36
36
|
- ./support/check_versions
|
37
|
-
- cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$(checksum $BUNDLE_GEMFILE),$_BUNDLER_CACHE-bundler-$RUBY_VERSION
|
37
|
+
- cache restore $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE),$_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET,$_BUNDLER_CACHE-bundler-$RUBY_VERSION
|
38
38
|
- cache restore $_GEMS_CACHE-gems-$RUBY_VERSION-$(checksum $BUNDLE_GEMFILE),$_GEMS_CACHE-gems-$RUBY_VERSION
|
39
39
|
- ./support/install_deps
|
40
|
+
- bundle config set clean 'true'
|
40
41
|
- ./support/bundler_wrapper install --jobs=3 --retry=3
|
41
42
|
epilogue:
|
42
43
|
on_pass:
|
43
44
|
commands:
|
44
|
-
- cache store $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$(checksum $BUNDLE_GEMFILE) .bundle
|
45
|
+
- cache store $_BUNDLER_CACHE-bundler-$RUBY_VERSION-$GEMSET-$(checksum $BUNDLE_GEMFILE) .bundle
|
45
46
|
- cache store $_GEMS_CACHE-gems-$RUBY_VERSION-$(checksum $BUNDLE_GEMFILE) $HOME/.gem
|
47
|
+
on_fail:
|
48
|
+
commands:
|
49
|
+
- "[ -e ext/install.report ] && cat ext/install.report || echo 'No ext/install.report file found'"
|
50
|
+
- "[ -f ext/mkmf.log ] && cat ext/mkmf.log || echo 'No ext/mkmf.log file found'"
|
46
51
|
|
47
52
|
blocks:
|
48
53
|
- name: Validation
|
@@ -53,6 +58,8 @@ semaphore: # Default `.semaphore/semaphore.yml` contents
|
|
53
58
|
env_vars:
|
54
59
|
- name: RUBY_VERSION
|
55
60
|
value: 2.6.5
|
61
|
+
- name: GEMSET
|
62
|
+
value: no_dependencies
|
56
63
|
- name: BUNDLE_GEMFILE
|
57
64
|
value: gemfiles/no_dependencies.gemfile
|
58
65
|
commands:
|
@@ -65,6 +72,8 @@ semaphore: # Default `.semaphore/semaphore.yml` contents
|
|
65
72
|
env_vars:
|
66
73
|
- name: RUBY_VERSION
|
67
74
|
value: 2.6.5
|
75
|
+
- name: GEMSET
|
76
|
+
value: no_dependencies
|
68
77
|
- name: BUNDLE_GEMFILE
|
69
78
|
value: gemfiles/no_dependencies.gemfile
|
70
79
|
commands:
|
@@ -81,8 +90,13 @@ matrix:
|
|
81
90
|
minimal:
|
82
91
|
- "no_dependencies"
|
83
92
|
- "rails-5.2"
|
93
|
+
- "rails-6.0"
|
84
94
|
|
85
95
|
ruby:
|
96
|
+
- ruby: "1.9.3-p551"
|
97
|
+
rubygems: "2.7.8"
|
98
|
+
bundler: "1.17.3"
|
99
|
+
gems: "none"
|
86
100
|
- ruby: "2.0.0-p648"
|
87
101
|
rubygems: "2.7.8"
|
88
102
|
bundler: "1.17.3"
|
@@ -148,6 +162,7 @@ matrix:
|
|
148
162
|
- "2.2.10"
|
149
163
|
- "2.3.8"
|
150
164
|
- "2.4.9"
|
165
|
+
- "jruby-9.1.17.0"
|
151
166
|
- gem: "resque"
|
152
167
|
bundler: "1.17.3"
|
153
168
|
- gem: "sequel"
|
data/ext/agent.yml
CHANGED
@@ -1,70 +1,70 @@
|
|
1
1
|
---
|
2
|
-
version:
|
2
|
+
version: 96b684b
|
3
3
|
mirrors:
|
4
4
|
- https://appsignal-agent-releases.global.ssl.fastly.net
|
5
5
|
- https://d135dj0rjqvssy.cloudfront.net
|
6
6
|
triples:
|
7
7
|
x86_64-darwin:
|
8
8
|
static:
|
9
|
-
checksum:
|
9
|
+
checksum: 6278d03abdcacde207e210374601b0a98eabace8cbc9fb74dffea3c18fc8a252
|
10
10
|
filename: appsignal-x86_64-darwin-all-static.tar.gz
|
11
11
|
dynamic:
|
12
|
-
checksum:
|
12
|
+
checksum: b0ad069bbff68acde7ef19de47938fa786771bae4821c757718f1894b9654a93
|
13
13
|
filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
|
14
14
|
universal-darwin:
|
15
15
|
static:
|
16
|
-
checksum:
|
16
|
+
checksum: 6278d03abdcacde207e210374601b0a98eabace8cbc9fb74dffea3c18fc8a252
|
17
17
|
filename: appsignal-x86_64-darwin-all-static.tar.gz
|
18
18
|
dynamic:
|
19
|
-
checksum:
|
19
|
+
checksum: b0ad069bbff68acde7ef19de47938fa786771bae4821c757718f1894b9654a93
|
20
20
|
filename: appsignal-x86_64-darwin-all-dynamic.tar.gz
|
21
21
|
i686-linux:
|
22
22
|
static:
|
23
|
-
checksum:
|
23
|
+
checksum: f3e79a575241a50d7968fe4743c4f4e5aebb840e0b8664d055383caf696d5d38
|
24
24
|
filename: appsignal-i686-linux-all-static.tar.gz
|
25
25
|
dynamic:
|
26
|
-
checksum:
|
26
|
+
checksum: 0df11c9fe85c9c94336dfb4df788032c78eda1ea648f98e8c1e4e213258816e1
|
27
27
|
filename: appsignal-i686-linux-all-dynamic.tar.gz
|
28
28
|
x86-linux:
|
29
29
|
static:
|
30
|
-
checksum:
|
30
|
+
checksum: f3e79a575241a50d7968fe4743c4f4e5aebb840e0b8664d055383caf696d5d38
|
31
31
|
filename: appsignal-i686-linux-all-static.tar.gz
|
32
32
|
dynamic:
|
33
|
-
checksum:
|
33
|
+
checksum: 0df11c9fe85c9c94336dfb4df788032c78eda1ea648f98e8c1e4e213258816e1
|
34
34
|
filename: appsignal-i686-linux-all-dynamic.tar.gz
|
35
35
|
i686-linux-musl:
|
36
36
|
static:
|
37
|
-
checksum:
|
37
|
+
checksum: 07ab5749b532f1cc6cb45a3334fd950f6d15edacbe6d1bfe25af75b24df73cd1
|
38
38
|
filename: appsignal-i686-linux-musl-all-static.tar.gz
|
39
39
|
x86-linux-musl:
|
40
40
|
static:
|
41
|
-
checksum:
|
41
|
+
checksum: 07ab5749b532f1cc6cb45a3334fd950f6d15edacbe6d1bfe25af75b24df73cd1
|
42
42
|
filename: appsignal-i686-linux-musl-all-static.tar.gz
|
43
43
|
x86_64-linux:
|
44
44
|
static:
|
45
|
-
checksum:
|
45
|
+
checksum: d0e8f48973bca7d783d654404617bb5ab4f47756deb6805c4876bfcda83981cd
|
46
46
|
filename: appsignal-x86_64-linux-all-static.tar.gz
|
47
47
|
dynamic:
|
48
|
-
checksum:
|
48
|
+
checksum: aff7569b04416cd40440d228c5b9881b860e1ecf597bc996ac02c2735f49d993
|
49
49
|
filename: appsignal-x86_64-linux-all-dynamic.tar.gz
|
50
50
|
x86_64-linux-musl:
|
51
51
|
static:
|
52
|
-
checksum:
|
52
|
+
checksum: 2e3db648d0883f2a7e72f1207ec0976b97d144cafe0a3e755df2d91ca93d113f
|
53
53
|
filename: appsignal-x86_64-linux-musl-all-static.tar.gz
|
54
54
|
dynamic:
|
55
|
-
checksum:
|
55
|
+
checksum: 5da62f954d761af47da16f34ab675b46fedd7b91b485574bf895b43896f61ce0
|
56
56
|
filename: appsignal-x86_64-linux-musl-all-dynamic.tar.gz
|
57
57
|
x86_64-freebsd:
|
58
58
|
static:
|
59
|
-
checksum:
|
59
|
+
checksum: 8dc226834ef39bac43dbc4a5c6a812c50c34669b0607036dd9494ac587e72d6a
|
60
60
|
filename: appsignal-x86_64-freebsd-all-static.tar.gz
|
61
61
|
dynamic:
|
62
|
-
checksum:
|
62
|
+
checksum: 0edfbaa450c89dba5750b306043efc00b82851dce2b75fa6ee62de07d30b4a3b
|
63
63
|
filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
|
64
64
|
amd64-freebsd:
|
65
65
|
static:
|
66
|
-
checksum:
|
66
|
+
checksum: 8dc226834ef39bac43dbc4a5c6a812c50c34669b0607036dd9494ac587e72d6a
|
67
67
|
filename: appsignal-x86_64-freebsd-all-static.tar.gz
|
68
68
|
dynamic:
|
69
|
-
checksum:
|
69
|
+
checksum: 0edfbaa450c89dba5750b306043efc00b82851dce2b75fa6ee62de07d30b4a3b
|
70
70
|
filename: appsignal-x86_64-freebsd-all-dynamic.tar.gz
|
data/ext/base.rb
CHANGED
@@ -142,14 +142,16 @@ def download_archive(type)
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def verify_archive(archive, type)
|
145
|
-
|
145
|
+
expected_checksum = ARCH_CONFIG[type]["checksum"]
|
146
|
+
actual_checksum = Digest::SHA256.hexdigest(archive.read)
|
147
|
+
if actual_checksum == expected_checksum
|
146
148
|
report["download"]["checksum"] = "verified"
|
147
149
|
true
|
148
150
|
else
|
149
151
|
report["download"]["checksum"] = "invalid"
|
150
152
|
abort_installation(
|
151
153
|
"Checksum of downloaded archive could not be verified: " \
|
152
|
-
"Expected '#{
|
154
|
+
"Expected '#{expected_checksum}', got '#{actual_checksum}'."
|
153
155
|
)
|
154
156
|
end
|
155
157
|
end
|
data/lib/appsignal.rb
CHANGED
@@ -6,6 +6,7 @@ require "securerandom"
|
|
6
6
|
require "appsignal/logger"
|
7
7
|
require "appsignal/helpers/instrumentation"
|
8
8
|
require "appsignal/helpers/metrics"
|
9
|
+
require "appsignal/utils/deprecation_message"
|
9
10
|
|
10
11
|
# AppSignal for Ruby gem's main module.
|
11
12
|
#
|
@@ -15,9 +16,9 @@ require "appsignal/helpers/metrics"
|
|
15
16
|
# {Appsignal::Helpers::Metrics}) for ease of use.
|
16
17
|
module Appsignal
|
17
18
|
class << self
|
18
|
-
extend Gem::Deprecate
|
19
19
|
include Helpers::Instrumentation
|
20
20
|
include Helpers::Metrics
|
21
|
+
include Utils::DeprecationMessage
|
21
22
|
|
22
23
|
# Accessor for the AppSignal configuration.
|
23
24
|
# Return the current AppSignal configuration.
|
@@ -280,16 +281,18 @@ module Appsignal
|
|
280
281
|
|
281
282
|
# @deprecated No replacement
|
282
283
|
def is_ignored_error?(error) # rubocop:disable Naming/PredicateName
|
284
|
+
deprecation_message "Appsignal.is_ignored_error? is deprecated " \
|
285
|
+
"with no replacement and will be removed in version 3.0."
|
283
286
|
Appsignal.config[:ignore_errors].include?(error.class.name)
|
284
287
|
end
|
285
288
|
alias :is_ignored_exception? :is_ignored_error?
|
286
|
-
deprecate :is_ignored_error?, :none, 2017, 3
|
287
289
|
|
288
290
|
# @deprecated No replacement
|
289
291
|
def is_ignored_action?(action) # rubocop:disable Naming/PredicateName
|
292
|
+
deprecation_message "Appsignal.is_ignored_action? is deprecated " \
|
293
|
+
"with no replacement and will be removed in version 3.0."
|
290
294
|
Appsignal.config[:ignore_actions].include?(action)
|
291
295
|
end
|
292
|
-
deprecate :is_ignored_action?, :none, 2017, 3
|
293
296
|
|
294
297
|
private
|
295
298
|
|
@@ -337,7 +337,7 @@ module Appsignal
|
|
337
337
|
path = File.expand_path("../../../../ext/install.report", __FILE__)
|
338
338
|
raw_report = File.read(path)
|
339
339
|
Utils.parse_yaml(raw_report)
|
340
|
-
rescue => e
|
340
|
+
rescue StandardError, Psych::SyntaxError => e # rubocop:disable Lint/ShadowedException
|
341
341
|
{
|
342
342
|
"parsing_error" => {
|
343
343
|
"error" => "#{e.class}: #{e}",
|
@@ -94,7 +94,7 @@ module Appsignal
|
|
94
94
|
"see our documentation for more information on the recommended " \
|
95
95
|
"method: " \
|
96
96
|
"https://docs.appsignal.com/application/markers/deploy-markers.html"
|
97
|
-
deprecation_message message
|
97
|
+
deprecation_message message
|
98
98
|
end
|
99
99
|
|
100
100
|
private
|
@@ -91,8 +91,7 @@ module Appsignal
|
|
91
91
|
"Formatter for '#{name}' is using a deprecated registration " \
|
92
92
|
"method. This event formatter will not be loaded. " \
|
93
93
|
"Please update the formatter according to the documentation at: " \
|
94
|
-
"https://docs.appsignal.com/ruby/instrumentation/event-formatters.html"
|
95
|
-
logger
|
94
|
+
"https://docs.appsignal.com/ruby/instrumentation/event-formatters.html"
|
96
95
|
|
97
96
|
EventFormatter.deprecated_formatter_classes[name] = self
|
98
97
|
end
|
@@ -27,9 +27,8 @@ module Appsignal
|
|
27
27
|
method_name = "perform"
|
28
28
|
else
|
29
29
|
# Delayed Job
|
30
|
-
args = extract_value(
|
31
|
-
|
32
|
-
class_name, method_name = class_and_method_name.split("#")
|
30
|
+
args = extract_value(payload, :args, {})
|
31
|
+
class_name, method_name = class_and_method_name_from_object_or_hash(payload, job.name)
|
33
32
|
end
|
34
33
|
|
35
34
|
params = Appsignal::Utils::HashSanitizer.sanitize(
|
@@ -54,6 +53,20 @@ module Appsignal
|
|
54
53
|
end
|
55
54
|
end
|
56
55
|
|
56
|
+
def self.class_and_method_name_from_object_or_hash(payload, default_name)
|
57
|
+
# Attempt to find appsignal_name override
|
58
|
+
class_and_method_name = extract_value(payload, :appsignal_name, nil)
|
59
|
+
return class_and_method_name.split("#") if class_and_method_name.is_a?(String)
|
60
|
+
|
61
|
+
pound_split = default_name.split("#")
|
62
|
+
return pound_split if pound_split.length == 2
|
63
|
+
|
64
|
+
dot_split = default_name.split(".")
|
65
|
+
return default_name if dot_split.length == 2
|
66
|
+
|
67
|
+
["unknown"]
|
68
|
+
end
|
69
|
+
|
57
70
|
def self.extract_value(object_or_hash, field, default_value = nil, convert_to_s = false)
|
58
71
|
value = nil
|
59
72
|
|
@@ -23,7 +23,8 @@ module Appsignal
|
|
23
23
|
begin
|
24
24
|
app.call(env)
|
25
25
|
rescue Exception => error # rubocop:disable Lint/RescueException
|
26
|
-
|
26
|
+
# Do not set error if "grape.skip_appsignal_error" is set to `true`.
|
27
|
+
transaction.set_error(error) unless env["grape.skip_appsignal_error"]
|
27
28
|
raise error
|
28
29
|
ensure
|
29
30
|
request_method = request.request_method.to_s.upcase
|
data/lib/appsignal/minutely.rb
CHANGED
@@ -33,8 +33,7 @@ module Appsignal
|
|
33
33
|
# @return [void]
|
34
34
|
def <<(probe)
|
35
35
|
deprecation_message "Deprecated `Appsignal::Minute.probes <<` " \
|
36
|
-
"call. Please use `Appsignal::Minutely.probes.register` instead."
|
37
|
-
logger
|
36
|
+
"call. Please use `Appsignal::Minutely.probes.register` instead."
|
38
37
|
register probe.object_id, probe
|
39
38
|
end
|
40
39
|
|
@@ -28,10 +28,9 @@ module Appsignal
|
|
28
28
|
def initialize(app, _options = nil)
|
29
29
|
Appsignal.logger.debug \
|
30
30
|
"Initializing Appsignal::Rack::JSExceptionCatcher"
|
31
|
-
|
32
|
-
"Please use the official AppSignal JavaScript
|
33
|
-
"https://docs.appsignal.com/front-end/"
|
34
|
-
deprecation_message message, Appsignal.logger
|
31
|
+
deprecation_message "The Appsignal::Rack::JSExceptionCatcher is " \
|
32
|
+
"deprecated. Please use the official AppSignal JavaScript " \
|
33
|
+
"integration instead. https://docs.appsignal.com/front-end/"
|
35
34
|
@app = app
|
36
35
|
end
|
37
36
|
|
@@ -248,7 +248,12 @@ module Appsignal
|
|
248
248
|
Appsignal::Utils::Data.generate(data)
|
249
249
|
)
|
250
250
|
rescue RuntimeError => e
|
251
|
-
|
251
|
+
begin
|
252
|
+
inspected_data = data.inspect
|
253
|
+
Appsignal.logger.error("Error generating data (#{e.class}: #{e.message}) for '#{inspected_data}'")
|
254
|
+
rescue => e
|
255
|
+
Appsignal.logger.error("Error generating data (#{e.class}: #{e.message}). Can't inspect data.")
|
256
|
+
end
|
252
257
|
end
|
253
258
|
|
254
259
|
def sample_data
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Appsignal
|
2
2
|
module Utils
|
3
3
|
module DeprecationMessage
|
4
|
-
def deprecation_message(message, logger)
|
5
|
-
$
|
4
|
+
def deprecation_message(message, logger = Appsignal.logger)
|
5
|
+
$stderr.puts "appsignal WARNING: #{message}"
|
6
6
|
logger.warn message
|
7
7
|
end
|
8
8
|
end
|
data/lib/appsignal/version.rb
CHANGED
@@ -38,7 +38,7 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
|
|
38
38
|
# Because this is saved on the class rather than an instance of the
|
39
39
|
# class we need to clear it like this in case a certain test doesn't
|
40
40
|
# generate a report.
|
41
|
-
cli_class.remove_instance_variable :@data
|
41
|
+
cli_class.send :remove_instance_variable, :@data
|
42
42
|
end
|
43
43
|
|
44
44
|
if DependencyHelper.rails_present?
|
@@ -5,6 +5,8 @@ describe Appsignal::CLI::NotifyOfDeploy do
|
|
5
5
|
|
6
6
|
let(:out_stream) { std_stream }
|
7
7
|
let(:output) { out_stream.read }
|
8
|
+
let(:err_stream) { std_stream }
|
9
|
+
let(:stderr) { err_stream.read }
|
8
10
|
|
9
11
|
define :include_deploy_notification do
|
10
12
|
match do |log|
|
@@ -32,7 +34,7 @@ describe Appsignal::CLI::NotifyOfDeploy do
|
|
32
34
|
end
|
33
35
|
|
34
36
|
def run
|
35
|
-
|
37
|
+
capture_std_streams(out_stream, err_stream) do
|
36
38
|
run_cli("notify_of_deploy", options)
|
37
39
|
end
|
38
40
|
end
|
@@ -130,7 +132,7 @@ describe Appsignal::CLI::NotifyOfDeploy do
|
|
130
132
|
it "prints a deprecation message" do
|
131
133
|
run
|
132
134
|
deprecation_message = "This command (appsignal notify_of_deploy) has been deprecated"
|
133
|
-
expect(
|
135
|
+
expect(stderr).to include("appsignal WARNING: #{deprecation_message}")
|
134
136
|
expect(log).to contains_log :warn, deprecation_message
|
135
137
|
end
|
136
138
|
|