appsignal 2.6.1-java → 2.7.0.alpha.1-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/.gitignore +1 -0
- data/.rubocop_todo.yml +21 -28
- data/CHANGELOG.md +3 -0
- data/ext/agent.yml +35 -35
- data/lib/appsignal.rb +1 -3
- data/lib/appsignal/cli/install.rb +11 -20
- data/lib/appsignal/transaction.rb +6 -6
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/cli/diagnose_spec.rb +3 -3
- data/spec/lib/appsignal/cli/helpers_spec.rb +27 -27
- data/spec/lib/appsignal/cli/install_spec.rb +8 -8
- data/spec/spec_helper.rb +1 -0
- data/spec/support/helpers/cli_helpers.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 917eeb084903e3fdcfd98871df30b2cb7745a0fa
|
|
4
|
+
data.tar.gz: 59b91a423a3b5cd3e5400532cd69fda474e27097
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cbdbdb05900c91030313e89370df126f22ee3d750aeaec21d99b810e76148ea7133b36b3e8c85401fc1e6b6e6cf9f6f1b3ee1d113a395781dcbd49f90ab75dce
|
|
7
|
+
data.tar.gz: 2337008dd6ab3f9de48c574efe06c0255f09fdaea39284c30d00af6d73e0334d290e136541c0b255a157e5f66b04ef62e24ce1f7e23681c6841f165a4bc5090c
|
data/.gitignore
CHANGED
data/.rubocop_todo.yml
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2018-05-06 12:47:25 +0200 using RuboCop version 0.50.0.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count:
|
|
10
|
-
Lint/HandleExceptions:
|
|
11
|
-
Exclude:
|
|
12
|
-
- 'lib/appsignal/cli/install.rb'
|
|
13
|
-
|
|
14
|
-
# Offense count: 41
|
|
9
|
+
# Offense count: 45
|
|
15
10
|
Metrics/AbcSize:
|
|
16
|
-
Max:
|
|
11
|
+
Max: 56
|
|
17
12
|
|
|
18
|
-
# Offense count:
|
|
19
|
-
# Configuration parameters: CountComments.
|
|
13
|
+
# Offense count: 7
|
|
14
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
|
20
15
|
Metrics/BlockLength:
|
|
21
16
|
Max: 31
|
|
22
17
|
|
|
@@ -29,17 +24,17 @@ Metrics/ClassLength:
|
|
|
29
24
|
- "lib/appsignal/config.rb"
|
|
30
25
|
- "lib/appsignal/transaction.rb"
|
|
31
26
|
|
|
32
|
-
# Offense count:
|
|
27
|
+
# Offense count: 16
|
|
33
28
|
Metrics/CyclomaticComplexity:
|
|
34
29
|
Max: 11
|
|
35
30
|
|
|
36
|
-
# Offense count:
|
|
31
|
+
# Offense count: 537
|
|
37
32
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
|
38
33
|
# URISchemes: http, https
|
|
39
34
|
Metrics/LineLength:
|
|
40
35
|
Max: 152
|
|
41
36
|
|
|
42
|
-
# Offense count:
|
|
37
|
+
# Offense count: 95
|
|
43
38
|
# Configuration parameters: CountComments.
|
|
44
39
|
Metrics/MethodLength:
|
|
45
40
|
Max: 60
|
|
@@ -50,16 +45,24 @@ Metrics/ModuleLength:
|
|
|
50
45
|
Exclude:
|
|
51
46
|
- "lib/appsignal.rb"
|
|
52
47
|
|
|
53
|
-
# Offense count:
|
|
48
|
+
# Offense count: 8
|
|
54
49
|
Metrics/PerceivedComplexity:
|
|
55
50
|
Max: 14
|
|
56
51
|
|
|
57
|
-
# Offense count:
|
|
52
|
+
# Offense count: 9
|
|
58
53
|
Naming/AccessorMethodName:
|
|
59
54
|
Exclude:
|
|
60
55
|
- 'lib/appsignal.rb'
|
|
61
56
|
- 'lib/appsignal/transaction.rb'
|
|
62
|
-
|
|
57
|
+
|
|
58
|
+
# Offense count: 4
|
|
59
|
+
# Cop supports --auto-correct.
|
|
60
|
+
Security/YAMLLoad:
|
|
61
|
+
Exclude:
|
|
62
|
+
- 'ext/base.rb'
|
|
63
|
+
- 'lib/appsignal/config.rb'
|
|
64
|
+
- 'lib/appsignal/extension.rb'
|
|
65
|
+
- 'lib/appsignal/hooks/sidekiq.rb'
|
|
63
66
|
|
|
64
67
|
# Offense count: 20
|
|
65
68
|
# Cop supports --auto-correct.
|
|
@@ -85,7 +88,7 @@ Style/ClassAndModuleChildren:
|
|
|
85
88
|
Exclude:
|
|
86
89
|
- 'lib/appsignal/integrations/padrino.rb'
|
|
87
90
|
|
|
88
|
-
# Offense count:
|
|
91
|
+
# Offense count: 4
|
|
89
92
|
Style/ClassVars:
|
|
90
93
|
Exclude:
|
|
91
94
|
- 'lib/appsignal/event_formatter.rb'
|
|
@@ -106,19 +109,9 @@ Style/GuardClause:
|
|
|
106
109
|
- 'lib/appsignal/hooks.rb'
|
|
107
110
|
- 'lib/appsignal/marker.rb'
|
|
108
111
|
|
|
109
|
-
# Offense count:
|
|
112
|
+
# Offense count: 1
|
|
110
113
|
# Cop supports --auto-correct.
|
|
111
114
|
# Configuration parameters: MaxLineLength.
|
|
112
115
|
Style/IfUnlessModifier:
|
|
113
116
|
Exclude:
|
|
114
117
|
- 'lib/appsignal.rb'
|
|
115
|
-
|
|
116
|
-
# Offense count: 1
|
|
117
|
-
# Cop supports --auto-correct.
|
|
118
|
-
# Configuration parameters: IncludeSemanticChanges.
|
|
119
|
-
Style/NonNilCheck:
|
|
120
|
-
Exclude:
|
|
121
|
-
- 'lib/appsignal/transaction.rb'
|
|
122
|
-
|
|
123
|
-
Security/YAMLLoad:
|
|
124
|
-
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/ext/agent.yml
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
---
|
|
2
|
-
version:
|
|
2
|
+
version: f1d8b5d
|
|
3
3
|
triples:
|
|
4
4
|
x86_64-darwin:
|
|
5
5
|
static:
|
|
6
|
-
checksum:
|
|
7
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
6
|
+
checksum: 4deeb24393c3bb51593de2c475b9c1395088dfd16cbd0af634cb0a75c004b426
|
|
7
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-x86_64-darwin-all-static.tar.gz
|
|
8
8
|
dynamic:
|
|
9
|
-
checksum:
|
|
10
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
9
|
+
checksum: 12ea534f44962c3d61859193eef939301b30d139fb23b60e311145400924bbd9
|
|
10
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-x86_64-darwin-all-dynamic.tar.gz
|
|
11
11
|
universal-darwin:
|
|
12
12
|
static:
|
|
13
|
-
checksum:
|
|
14
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
13
|
+
checksum: 4deeb24393c3bb51593de2c475b9c1395088dfd16cbd0af634cb0a75c004b426
|
|
14
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-x86_64-darwin-all-static.tar.gz
|
|
15
15
|
dynamic:
|
|
16
|
-
checksum:
|
|
17
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
16
|
+
checksum: 12ea534f44962c3d61859193eef939301b30d139fb23b60e311145400924bbd9
|
|
17
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-x86_64-darwin-all-dynamic.tar.gz
|
|
18
18
|
i686-linux:
|
|
19
19
|
static:
|
|
20
|
-
checksum:
|
|
21
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
20
|
+
checksum: 61df57d8342f6e88d842067ea676ec6d2961866491f4ca7178f3455845d63be4
|
|
21
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-i686-linux-all-static.tar.gz
|
|
22
22
|
dynamic:
|
|
23
|
-
checksum:
|
|
24
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
23
|
+
checksum: b7198c0e15099182914d789630bce308a58d3f4db3df78b5ad23646cb84085b2
|
|
24
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-i686-linux-all-dynamic.tar.gz
|
|
25
25
|
x86-linux:
|
|
26
26
|
static:
|
|
27
|
-
checksum:
|
|
28
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
27
|
+
checksum: 61df57d8342f6e88d842067ea676ec6d2961866491f4ca7178f3455845d63be4
|
|
28
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-i686-linux-all-static.tar.gz
|
|
29
29
|
dynamic:
|
|
30
|
-
checksum:
|
|
31
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
30
|
+
checksum: b7198c0e15099182914d789630bce308a58d3f4db3df78b5ad23646cb84085b2
|
|
31
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-i686-linux-all-dynamic.tar.gz
|
|
32
32
|
i686-linux-musl:
|
|
33
33
|
static:
|
|
34
|
-
checksum:
|
|
35
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
34
|
+
checksum: f3965cffd01eb9ac5d29262dbe59af0fcc376d37b6192d0bade1e17bd8ae87e2
|
|
35
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-i686-linux-musl-all-static.tar.gz
|
|
36
36
|
x86-linux-musl:
|
|
37
37
|
static:
|
|
38
|
-
checksum:
|
|
39
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
38
|
+
checksum: f3965cffd01eb9ac5d29262dbe59af0fcc376d37b6192d0bade1e17bd8ae87e2
|
|
39
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-i686-linux-musl-all-static.tar.gz
|
|
40
40
|
x86_64-linux:
|
|
41
41
|
static:
|
|
42
|
-
checksum:
|
|
43
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
42
|
+
checksum: eb85d8ba8ec10c1d85125b6af1bf44fb85ac2139ebc15627d740994641c0d8e8
|
|
43
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-x86_64-linux-all-static.tar.gz
|
|
44
44
|
dynamic:
|
|
45
|
-
checksum:
|
|
46
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
45
|
+
checksum: 5324a8d024cb46a746e4ca129271505d5a566bc193722a7581a7b5c8c8e8dd1e
|
|
46
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-x86_64-linux-all-dynamic.tar.gz
|
|
47
47
|
x86_64-linux-musl:
|
|
48
48
|
static:
|
|
49
|
-
checksum:
|
|
50
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
49
|
+
checksum: 6ac6595829898d6b45647f774ca3570bfe15d7a889cff6e623332c4f20e11622
|
|
50
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-x86_64-linux-musl-all-static.tar.gz
|
|
51
51
|
x86_64-freebsd:
|
|
52
52
|
static:
|
|
53
|
-
checksum:
|
|
54
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
53
|
+
checksum: 2ff73b4a30022855a4f805a6183378da3ba352a613429547d4a7d5e815d5e31d
|
|
54
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-x86_64-freebsd-all-static.tar.gz
|
|
55
55
|
dynamic:
|
|
56
|
-
checksum:
|
|
57
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
56
|
+
checksum: fcdfdfffedb333b301074f9b8b6fc9593977cd0886194e0ff0878b5008b32e12
|
|
57
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-x86_64-freebsd-all-dynamic.tar.gz
|
|
58
58
|
amd64-freebsd:
|
|
59
59
|
static:
|
|
60
|
-
checksum:
|
|
61
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
60
|
+
checksum: 2ff73b4a30022855a4f805a6183378da3ba352a613429547d4a7d5e815d5e31d
|
|
61
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-x86_64-freebsd-all-static.tar.gz
|
|
62
62
|
dynamic:
|
|
63
|
-
checksum:
|
|
64
|
-
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/
|
|
63
|
+
checksum: fcdfdfffedb333b301074f9b8b6fc9593977cd0886194e0ff0878b5008b32e12
|
|
64
|
+
download_url: https://appsignal-agent-releases.global.ssl.fastly.net/f1d8b5d/appsignal-x86_64-freebsd-all-dynamic.tar.gz
|
data/lib/appsignal.rb
CHANGED
|
@@ -228,9 +228,7 @@ module Appsignal
|
|
|
228
228
|
# @return [Object] the value of the given block is returned.
|
|
229
229
|
# @since 0.10.0
|
|
230
230
|
def monitor_transaction(name, env = {})
|
|
231
|
-
unless active?
|
|
232
|
-
return yield
|
|
233
|
-
end
|
|
231
|
+
return yield unless active?
|
|
234
232
|
|
|
235
233
|
if name.start_with?("perform_job".freeze)
|
|
236
234
|
namespace = Appsignal::Transaction::BACKGROUND_JOB
|
|
@@ -228,29 +228,20 @@ module Appsignal
|
|
|
228
228
|
|
|
229
229
|
def installed_frameworks
|
|
230
230
|
[].tap do |out|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
end
|
|
236
|
-
begin
|
|
237
|
-
require "sinatra"
|
|
238
|
-
out << :sinatra
|
|
239
|
-
rescue LoadError
|
|
240
|
-
end
|
|
241
|
-
begin
|
|
242
|
-
require "padrino"
|
|
243
|
-
out << :padrino
|
|
244
|
-
rescue LoadError
|
|
245
|
-
end
|
|
246
|
-
begin
|
|
247
|
-
require "grape"
|
|
248
|
-
out << :grape
|
|
249
|
-
rescue LoadError
|
|
250
|
-
end
|
|
231
|
+
out << :rails if framework_available? "rails"
|
|
232
|
+
out << :sinatra if framework_available? "sinatra"
|
|
233
|
+
out << :padrino if framework_available? "padrino"
|
|
234
|
+
out << :grape if framework_available? "grape"
|
|
251
235
|
end
|
|
252
236
|
end
|
|
253
237
|
|
|
238
|
+
def framework_available?(framework_file)
|
|
239
|
+
require framework_file
|
|
240
|
+
true
|
|
241
|
+
rescue LoadError
|
|
242
|
+
false
|
|
243
|
+
end
|
|
244
|
+
|
|
254
245
|
def rails_environments
|
|
255
246
|
Dir.glob(
|
|
256
247
|
File.join(Dir.pwd, "config/environments/*.rb")
|
|
@@ -18,17 +18,17 @@ module Appsignal
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
# Check if we already have a running transaction
|
|
21
|
-
if Thread.current[:appsignal_transaction]
|
|
22
|
-
#
|
|
21
|
+
if Thread.current[:appsignal_transaction].nil?
|
|
22
|
+
# If not, start a new transaction
|
|
23
|
+
Thread.current[:appsignal_transaction] = Appsignal::Transaction.new(id, namespace, request, options)
|
|
24
|
+
else
|
|
25
|
+
# Otherwise, log the issue about trying to start another transaction
|
|
23
26
|
Appsignal.logger.debug "Trying to start new transaction with id " \
|
|
24
27
|
"'#{id}', but a transaction with id '#{current.transaction_id}' " \
|
|
25
28
|
"is already running. Using transaction '#{current.transaction_id}'."
|
|
26
29
|
|
|
27
|
-
#
|
|
30
|
+
# And return the current transaction instead
|
|
28
31
|
current
|
|
29
|
-
else
|
|
30
|
-
# Otherwise, start a new transaction
|
|
31
|
-
Thread.current[:appsignal_transaction] = Appsignal::Transaction.new(id, namespace, request, options)
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
data/lib/appsignal/version.rb
CHANGED
|
@@ -63,7 +63,7 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :report => true do
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def run_within_dir(chdir)
|
|
66
|
-
|
|
66
|
+
prepare_cli_input
|
|
67
67
|
Dir.chdir chdir do
|
|
68
68
|
capture_stdout(out_stream) { cli.run(options) }
|
|
69
69
|
end
|
|
@@ -83,11 +83,11 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :report => true do
|
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
def send_diagnostics_report
|
|
86
|
-
|
|
86
|
+
add_cli_input "y"
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
def dont_send_diagnostics_report
|
|
90
|
-
|
|
90
|
+
add_cli_input "n"
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
it "outputs header and support text" do
|
|
@@ -50,8 +50,8 @@ describe Appsignal::CLI::Helpers do
|
|
|
50
50
|
|
|
51
51
|
describe ".press_any_key" do
|
|
52
52
|
before do
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
add_cli_input "a" # a as in any
|
|
54
|
+
prepare_cli_input
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
it "continues after press" do
|
|
@@ -62,15 +62,15 @@ describe Appsignal::CLI::Helpers do
|
|
|
62
62
|
|
|
63
63
|
describe ".ask_for_input" do
|
|
64
64
|
it "returns the input" do
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
add_cli_input "foo"
|
|
66
|
+
prepare_cli_input
|
|
67
67
|
expect(cli.send(:ask_for_input)).to eq("foo")
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
context "with input ending with a line break" do
|
|
71
71
|
it "returns only the input" do
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
add_cli_input "foo\n"
|
|
73
|
+
prepare_cli_input
|
|
74
74
|
expect(cli.send(:ask_for_input)).to eq("foo")
|
|
75
75
|
end
|
|
76
76
|
end
|
|
@@ -94,47 +94,47 @@ describe Appsignal::CLI::Helpers do
|
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
it "takes 'y' for an answer" do
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
add_cli_input ""
|
|
98
|
+
add_cli_input "nonsense"
|
|
99
|
+
add_cli_input "y"
|
|
100
|
+
prepare_cli_input
|
|
101
101
|
|
|
102
102
|
expect(yes_or_no).to be_truthy
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
it "takes 'Y' for an answer" do
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
add_cli_input "Y"
|
|
107
|
+
prepare_cli_input
|
|
108
108
|
|
|
109
109
|
expect(yes_or_no).to be_truthy
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
it "takes 'yes' for an answer" do
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
add_cli_input "yes"
|
|
114
|
+
prepare_cli_input
|
|
115
115
|
|
|
116
116
|
expect(yes_or_no).to be_truthy
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
it "takes 'n' for an answer" do
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
add_cli_input ""
|
|
121
|
+
add_cli_input "nonsense"
|
|
122
|
+
add_cli_input "n"
|
|
123
|
+
prepare_cli_input
|
|
124
124
|
|
|
125
125
|
expect(yes_or_no).to be_falsy
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
it "takes 'N' for an answer" do
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
add_cli_input "N"
|
|
130
|
+
prepare_cli_input
|
|
131
131
|
|
|
132
132
|
expect(yes_or_no).to be_falsy
|
|
133
133
|
end
|
|
134
134
|
|
|
135
135
|
it "takes 'no' for an answer" do
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
add_cli_input "no"
|
|
137
|
+
prepare_cli_input
|
|
138
138
|
|
|
139
139
|
expect(yes_or_no).to be_falsy
|
|
140
140
|
end
|
|
@@ -147,8 +147,8 @@ describe Appsignal::CLI::Helpers do
|
|
|
147
147
|
end
|
|
148
148
|
|
|
149
149
|
it "returns the default if no input is received from the user" do
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
add_cli_input ""
|
|
151
|
+
prepare_cli_input
|
|
152
152
|
|
|
153
153
|
expect(yes_or_no).to be_truthy
|
|
154
154
|
end
|
|
@@ -161,9 +161,9 @@ describe Appsignal::CLI::Helpers do
|
|
|
161
161
|
end
|
|
162
162
|
|
|
163
163
|
it "collects required input" do
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
add_cli_input ""
|
|
165
|
+
add_cli_input "value"
|
|
166
|
+
prepare_cli_input
|
|
167
167
|
|
|
168
168
|
expect(required_input).to eq("value")
|
|
169
169
|
end
|
|
@@ -73,19 +73,19 @@ describe Appsignal::CLI::Install do
|
|
|
73
73
|
stub_api_request config, "auth"
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
alias_method :enter_app_name, :
|
|
76
|
+
alias_method :enter_app_name, :add_cli_input
|
|
77
77
|
|
|
78
78
|
def choose_config_file
|
|
79
|
-
|
|
79
|
+
add_cli_input "1"
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
def choose_environment_config
|
|
83
|
-
|
|
83
|
+
add_cli_input "2"
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
def run
|
|
87
87
|
Dir.chdir tmp_dir do
|
|
88
|
-
|
|
88
|
+
prepare_cli_input
|
|
89
89
|
capture_stdout(out_stream) do
|
|
90
90
|
run_cli(["install", push_api_key])
|
|
91
91
|
end
|
|
@@ -160,7 +160,7 @@ describe Appsignal::CLI::Install do
|
|
|
160
160
|
FileUtils.mkdir_p(tmp_dir)
|
|
161
161
|
|
|
162
162
|
enter_app_name "foo"
|
|
163
|
-
|
|
163
|
+
add_cli_input "n"
|
|
164
164
|
choose_environment_config
|
|
165
165
|
end
|
|
166
166
|
after do
|
|
@@ -262,7 +262,7 @@ describe Appsignal::CLI::Install do
|
|
|
262
262
|
before do
|
|
263
263
|
File.delete(File.join(environments_dir, "development.rb"))
|
|
264
264
|
File.delete(File.join(environments_dir, "staging.rb"))
|
|
265
|
-
|
|
265
|
+
add_cli_input "n"
|
|
266
266
|
choose_config_file
|
|
267
267
|
end
|
|
268
268
|
|
|
@@ -283,7 +283,7 @@ describe Appsignal::CLI::Install do
|
|
|
283
283
|
end
|
|
284
284
|
|
|
285
285
|
context "without custom name" do
|
|
286
|
-
before {
|
|
286
|
+
before { add_cli_input "n" }
|
|
287
287
|
|
|
288
288
|
it_behaves_like "push_api_key validation"
|
|
289
289
|
|
|
@@ -338,7 +338,7 @@ describe Appsignal::CLI::Install do
|
|
|
338
338
|
|
|
339
339
|
context "with custom name" do
|
|
340
340
|
let(:app_name) { "Custom name" }
|
|
341
|
-
before {
|
|
341
|
+
before { add_cli_input "y" }
|
|
342
342
|
|
|
343
343
|
it_behaves_like "push_api_key validation"
|
|
344
344
|
|
data/spec/spec_helper.rb
CHANGED
|
@@ -15,11 +15,11 @@ module CLIHelpers
|
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
def
|
|
18
|
+
def add_cli_input(value)
|
|
19
19
|
$stdin.puts value
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
def
|
|
22
|
+
def prepare_cli_input
|
|
23
23
|
# Prepare the input by rewinding the pointer in the StringIO
|
|
24
24
|
$stdin.rewind
|
|
25
25
|
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.
|
|
4
|
+
version: 2.7.0.alpha.1
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Beekman
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2018-05-
|
|
12
|
+
date: 2018-05-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rack
|
|
@@ -371,12 +371,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
371
371
|
version: '1.9'
|
|
372
372
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
373
373
|
requirements:
|
|
374
|
-
- - "
|
|
374
|
+
- - ">"
|
|
375
375
|
- !ruby/object:Gem::Version
|
|
376
|
-
version:
|
|
376
|
+
version: 1.3.1
|
|
377
377
|
requirements: []
|
|
378
378
|
rubyforge_project:
|
|
379
|
-
rubygems_version: 2.
|
|
379
|
+
rubygems_version: 2.5.2.3
|
|
380
380
|
signing_key:
|
|
381
381
|
specification_version: 4
|
|
382
382
|
summary: Logs performance and exception data from your app to appsignal.com
|