appsignal 2.8.1 → 2.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +137 -75
- data/CHANGELOG.md +4 -0
- data/Rakefile +59 -0
- data/build_matrix.yml +106 -0
- data/gemfiles/rails-5.2.gemfile +5 -0
- data/lib/appsignal/cli/diagnose.rb +0 -2
- data/lib/appsignal/cli/diagnose/paths.rb +3 -2
- data/lib/appsignal/hooks.rb +0 -19
- data/lib/appsignal/integrations/delayed_job_plugin.rb +27 -0
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/cli/diagnose/paths_spec.rb +16 -0
- data/spec/lib/appsignal/cli/diagnose_spec.rb +6 -6
- data/spec/lib/appsignal/hooks/delayed_job_spec.rb +137 -0
- data/spec/lib/appsignal/hooks_spec.rb +0 -79
- data/support/bundler_wrapper +12 -0
- data/support/install_deps +21 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d187139d632ca0077d520970d83565bf1f5fc258bf7f1ca8d02c52fe2a7370a1
|
4
|
+
data.tar.gz: 9ff2c5e1a0f24b379c84ea121b4844e4a0e5c3c7a84af28afbccaab9b3a58dbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1701aca2c74c3a9ff2b4ab637540661875c46b48b2d8fdb2f4093f2fb96ae8cb51b1f6356a67ae44a0e06bf78367716d28fc49306a8ab47c354574ef81a537f1
|
7
|
+
data.tar.gz: 33daa43c671018aecc5fc29114cf1a39b93682b782434e0ba24862ccd35e028ec66fa0c7c2904f81060c3cc5692c1e3ac8e78aa792d9db8a4e27de2b605bef0e
|
data/.travis.yml
CHANGED
@@ -1,86 +1,148 @@
|
|
1
|
+
# DO NOT EDIT
|
2
|
+
# This is a generated file by the `rake travis:generate` task.
|
3
|
+
# See `build_matrix.yml` for the build matrix.
|
4
|
+
# Generate this file with `rake travis:generate`.
|
5
|
+
---
|
1
6
|
sudo: false
|
2
|
-
|
3
7
|
branches:
|
4
8
|
only:
|
5
|
-
|
6
|
-
|
7
|
-
|
9
|
+
- master
|
10
|
+
- develop
|
8
11
|
language: ruby
|
9
12
|
cache:
|
10
13
|
directories:
|
11
|
-
|
12
|
-
|
13
|
-
rvm:
|
14
|
-
- "2.0.0"
|
15
|
-
- "2.3.8"
|
16
|
-
- "2.4.5"
|
17
|
-
- "2.5.3"
|
18
|
-
- "2.6.0"
|
19
|
-
- "jruby-19mode"
|
20
|
-
|
21
|
-
gemfile:
|
22
|
-
- "gemfiles/capistrano2.gemfile"
|
23
|
-
- "gemfiles/capistrano3.gemfile"
|
24
|
-
- "gemfiles/no_dependencies.gemfile"
|
25
|
-
- "gemfiles/padrino.gemfile"
|
26
|
-
- "gemfiles/rails-3.2.gemfile"
|
27
|
-
- "gemfiles/rails-4.0.gemfile"
|
28
|
-
- "gemfiles/rails-4.1.gemfile"
|
29
|
-
- "gemfiles/rails-4.2.gemfile"
|
30
|
-
- "gemfiles/rails-5.0.gemfile"
|
31
|
-
- "gemfiles/rails-5.1.gemfile"
|
32
|
-
- "gemfiles/resque.gemfile"
|
33
|
-
- "gemfiles/sequel.gemfile"
|
34
|
-
- "gemfiles/sequel-435.gemfile"
|
35
|
-
- "gemfiles/sinatra.gemfile"
|
36
|
-
- "gemfiles/grape.gemfile"
|
37
|
-
- "gemfiles/webmachine.gemfile"
|
38
|
-
- "gemfiles/que.gemfile"
|
39
|
-
|
40
|
-
matrix:
|
41
|
-
fast_finish: true
|
42
|
-
include:
|
43
|
-
- rvm: "2.1.8"
|
44
|
-
gemfile: "gemfiles/no_dependencies.gemfile"
|
45
|
-
- rvm: "2.2.4"
|
46
|
-
gemfile: "gemfiles/no_dependencies.gemfile"
|
47
|
-
- rvm: "2.5.3"
|
48
|
-
gemfile: "gemfiles/no_dependencies.gemfile"
|
49
|
-
script: "bundle exec rubocop"
|
50
|
-
exclude:
|
51
|
-
# Rails 5 doesn't support Ruby < 2.2
|
52
|
-
- rvm: "2.0.0"
|
53
|
-
gemfile: "gemfiles/rails-5.0.gemfile"
|
54
|
-
- rvm: "2.0.0"
|
55
|
-
gemfile: "gemfiles/rails-5.1.gemfile"
|
56
|
-
- rvm: "2.5.3"
|
57
|
-
gemfile: "gemfiles/rails-4.0.gemfile"
|
58
|
-
- rvm: "2.5.3"
|
59
|
-
gemfile: "gemfiles/rails-4.1.gemfile"
|
60
|
-
- rvm: "2.6.0"
|
61
|
-
gemfile: "gemfiles/rails-4.0.gemfile"
|
62
|
-
- rvm: "2.6.0"
|
63
|
-
gemfile: "gemfiles/rails-4.1.gemfile"
|
64
|
-
|
65
|
-
allow_failures:
|
66
|
-
- rvm: "2.4.5"
|
67
|
-
gemfile: "gemfiles/rails-4.0.gemfile"
|
68
|
-
- rvm: "2.4.5"
|
69
|
-
gemfile: "gemfiles/rails-4.1.gemfile"
|
70
|
-
|
14
|
+
- vendor/bundle
|
71
15
|
env:
|
72
16
|
global:
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
17
|
+
- RUNNING_IN_CI=true
|
18
|
+
- RAILS_ENV=test
|
19
|
+
- JRUBY_OPTS=''
|
77
20
|
before_install:
|
78
|
-
|
79
|
-
|
21
|
+
- "./support/install_deps"
|
22
|
+
install: "./support/bundler_wrapper install --jobs=3 --retry=3"
|
80
23
|
before_script:
|
81
|
-
|
24
|
+
- "./support/bundler_wrapper exec rake extension:install"
|
25
|
+
script: "./support/bundler_wrapper exec rake test"
|
82
26
|
after_failure:
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
27
|
+
- find ./ext -name install.log -exec cat {} \;
|
28
|
+
- find ./ext -name mkmf.log -exec cat {} \;
|
29
|
+
matrix:
|
30
|
+
fast_finish: true
|
31
|
+
include:
|
32
|
+
- rvm: 2.6.0
|
33
|
+
gemfile: gemfiles/no_dependencies.gemfile
|
34
|
+
before_script: ''
|
35
|
+
script:
|
36
|
+
- "./support/bundler_wrapper exec rake travis:validate"
|
37
|
+
- "./support/bundler_wrapper exec rubocop"
|
38
|
+
- rvm: 2.0.0
|
39
|
+
gemfile: gemfiles/no_dependencies.gemfile
|
40
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=latest
|
41
|
+
- rvm: 2.0.0
|
42
|
+
gemfile: gemfiles/capistrano2.gemfile
|
43
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=latest
|
44
|
+
- rvm: 2.0.0
|
45
|
+
gemfile: gemfiles/capistrano3.gemfile
|
46
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=latest
|
47
|
+
- rvm: 2.0.0
|
48
|
+
gemfile: gemfiles/grape.gemfile
|
49
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=latest
|
50
|
+
- rvm: 2.0.0
|
51
|
+
gemfile: gemfiles/padrino.gemfile
|
52
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=1.17.3
|
53
|
+
- rvm: 2.0.0
|
54
|
+
gemfile: gemfiles/que.gemfile
|
55
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=latest
|
56
|
+
- rvm: 2.0.0
|
57
|
+
gemfile: gemfiles/rails-3.2.gemfile
|
58
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=1.17.3
|
59
|
+
- rvm: 2.0.0
|
60
|
+
gemfile: gemfiles/rails-4.2.gemfile
|
61
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=1.17.3
|
62
|
+
- rvm: 2.0.0
|
63
|
+
gemfile: gemfiles/resque.gemfile
|
64
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=1.17.3
|
65
|
+
- rvm: 2.0.0
|
66
|
+
gemfile: gemfiles/sequel.gemfile
|
67
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=latest
|
68
|
+
- rvm: 2.0.0
|
69
|
+
gemfile: gemfiles/sequel-435.gemfile
|
70
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=latest
|
71
|
+
- rvm: 2.0.0
|
72
|
+
gemfile: gemfiles/sinatra.gemfile
|
73
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=latest
|
74
|
+
- rvm: 2.0.0
|
75
|
+
gemfile: gemfiles/webmachine.gemfile
|
76
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=latest
|
77
|
+
- rvm: 2.1.8
|
78
|
+
gemfile: gemfiles/no_dependencies.gemfile
|
79
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=latest
|
80
|
+
- rvm: 2.2.4
|
81
|
+
gemfile: gemfiles/no_dependencies.gemfile
|
82
|
+
env: _RUBYGEMS_VERSION=2.7.8 _BUNDLER_VERSION=latest
|
83
|
+
- rvm: 2.3.8
|
84
|
+
gemfile: gemfiles/no_dependencies.gemfile
|
85
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
86
|
+
- rvm: 2.4.5
|
87
|
+
gemfile: gemfiles/no_dependencies.gemfile
|
88
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
89
|
+
- rvm: 2.5.3
|
90
|
+
gemfile: gemfiles/no_dependencies.gemfile
|
91
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
92
|
+
- rvm: 2.5.3
|
93
|
+
gemfile: gemfiles/rails-4.2.gemfile
|
94
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=1.17.3
|
95
|
+
- rvm: 2.5.3
|
96
|
+
gemfile: gemfiles/rails-5.2.gemfile
|
97
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
98
|
+
- rvm: 2.6.0
|
99
|
+
gemfile: gemfiles/no_dependencies.gemfile
|
100
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
101
|
+
- rvm: 2.6.0
|
102
|
+
gemfile: gemfiles/capistrano2.gemfile
|
103
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
104
|
+
- rvm: 2.6.0
|
105
|
+
gemfile: gemfiles/capistrano3.gemfile
|
106
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
107
|
+
- rvm: 2.6.0
|
108
|
+
gemfile: gemfiles/grape.gemfile
|
109
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
110
|
+
- rvm: 2.6.0
|
111
|
+
gemfile: gemfiles/padrino.gemfile
|
112
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=1.17.3
|
113
|
+
- rvm: 2.6.0
|
114
|
+
gemfile: gemfiles/que.gemfile
|
115
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
116
|
+
- rvm: 2.6.0
|
117
|
+
gemfile: gemfiles/rails-5.0.gemfile
|
118
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
119
|
+
- rvm: 2.6.0
|
120
|
+
gemfile: gemfiles/rails-5.1.gemfile
|
121
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
122
|
+
- rvm: 2.6.0
|
123
|
+
gemfile: gemfiles/rails-5.2.gemfile
|
124
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
125
|
+
- rvm: 2.6.0
|
126
|
+
gemfile: gemfiles/resque.gemfile
|
127
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=1.17.3
|
128
|
+
- rvm: 2.6.0
|
129
|
+
gemfile: gemfiles/sequel.gemfile
|
130
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
131
|
+
- rvm: 2.6.0
|
132
|
+
gemfile: gemfiles/sequel-435.gemfile
|
133
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
134
|
+
- rvm: 2.6.0
|
135
|
+
gemfile: gemfiles/sinatra.gemfile
|
136
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
137
|
+
- rvm: 2.6.0
|
138
|
+
gemfile: gemfiles/webmachine.gemfile
|
139
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
140
|
+
- rvm: jruby-19mode
|
141
|
+
gemfile: gemfiles/no_dependencies.gemfile
|
142
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
143
|
+
- rvm: jruby-19mode
|
144
|
+
gemfile: gemfiles/rails-4.2.gemfile
|
145
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=1.17.3
|
146
|
+
- rvm: jruby-19mode
|
147
|
+
gemfile: gemfiles/rails-5.2.gemfile
|
148
|
+
env: _RUBYGEMS_VERSION=latest _BUNDLER_VERSION=latest
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -39,6 +39,65 @@ VERSION_MANAGERS = {
|
|
39
39
|
:rvm => ->(version) { "rvm use --default #{version.split("-").first}" }
|
40
40
|
}.freeze
|
41
41
|
|
42
|
+
namespace :travis do
|
43
|
+
task :generate do
|
44
|
+
yaml = YAML.load_file("build_matrix.yml")
|
45
|
+
matrix = yaml["matrix"]
|
46
|
+
defaults = matrix["defaults"]
|
47
|
+
gems = matrix["gems"]
|
48
|
+
|
49
|
+
builds = []
|
50
|
+
matrix["ruby"].each do |ruby|
|
51
|
+
ruby_version = ruby["ruby"]
|
52
|
+
gemset =
|
53
|
+
if ruby["gems"]
|
54
|
+
# Only a specific gemset for this Ruby
|
55
|
+
selected_gems = matrix["gemsets"].fetch(ruby["gems"])
|
56
|
+
gems.select { |g| selected_gems.include?(g["gem"]) }
|
57
|
+
else
|
58
|
+
# All gems for this Ruby
|
59
|
+
gems
|
60
|
+
end
|
61
|
+
gemset.each do |gem|
|
62
|
+
# Don't add build if ignored for this combination of Ruby and gem
|
63
|
+
next if (gem.dig("exclude", "ruby") || []).include?(ruby_version)
|
64
|
+
|
65
|
+
env = ""
|
66
|
+
rubygems = gem["rubygems"] || ruby["rubygems"] || defaults["rubygems"]
|
67
|
+
env = "_RUBYGEMS_VERSION=#{rubygems}" if rubygems
|
68
|
+
bundler = gem["bundler"] || ruby["bundler"] || defaults["bundler"]
|
69
|
+
env += " _BUNDLER_VERSION=#{bundler}" if bundler
|
70
|
+
|
71
|
+
builds << {
|
72
|
+
"rvm" => ruby_version,
|
73
|
+
"gemfile" => "gemfiles/#{gem["gem"]}.gemfile",
|
74
|
+
"env" => env
|
75
|
+
}
|
76
|
+
end
|
77
|
+
end
|
78
|
+
travis = yaml["travis"]
|
79
|
+
travis["matrix"]["include"] = travis["matrix"]["include"] + builds
|
80
|
+
|
81
|
+
header = "# DO NOT EDIT\n" \
|
82
|
+
"# This is a generated file by the `rake travis:generate` task.\n" \
|
83
|
+
"# See `build_matrix.yml` for the build matrix.\n" \
|
84
|
+
"# Generate this file with `rake travis:generate`.\n"
|
85
|
+
generated_yaml = header + YAML.dump(travis)
|
86
|
+
File.write(".travis.yml", generated_yaml)
|
87
|
+
puts "Generated `.travis.yml`"
|
88
|
+
puts "Build count: #{builds.length}"
|
89
|
+
end
|
90
|
+
|
91
|
+
task :validate => :generate do
|
92
|
+
`git status | grep .travis.yml 2>&1`
|
93
|
+
if $?.exitstatus.zero? # rubocop:disable Style/SpecialGlobalVars
|
94
|
+
puts "The `.travis.yml` is modified. The changes were not committed."
|
95
|
+
puts "Please run `rake travis:generate` and commit the changes."
|
96
|
+
exit 1
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
42
101
|
namespace :build do
|
43
102
|
def modify_base_gemspec
|
44
103
|
eval(File.read("appsignal.gemspec")).tap do |s| # rubocop:disable Security/Eval
|
data/build_matrix.yml
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
travis: # Default `.travis.yml` contents
|
2
|
+
sudo: false
|
3
|
+
|
4
|
+
branches:
|
5
|
+
only:
|
6
|
+
- "master"
|
7
|
+
- "develop"
|
8
|
+
|
9
|
+
language: ruby
|
10
|
+
cache:
|
11
|
+
directories:
|
12
|
+
- vendor/bundle
|
13
|
+
|
14
|
+
env:
|
15
|
+
global:
|
16
|
+
- "RUNNING_IN_CI=true"
|
17
|
+
- "RAILS_ENV=test"
|
18
|
+
- "JRUBY_OPTS=''" # Workaround https://github.com/travis-ci/travis-ci/issues/6471
|
19
|
+
|
20
|
+
before_install:
|
21
|
+
- "./support/install_deps"
|
22
|
+
install: "./support/bundler_wrapper install --jobs=3 --retry=3"
|
23
|
+
before_script:
|
24
|
+
- "./support/bundler_wrapper exec rake extension:install"
|
25
|
+
script: "./support/bundler_wrapper exec rake test"
|
26
|
+
after_failure:
|
27
|
+
- "find ./ext -name install.log -exec cat {} \\;"
|
28
|
+
- "find ./ext -name mkmf.log -exec cat {} \\;"
|
29
|
+
|
30
|
+
matrix:
|
31
|
+
fast_finish: true
|
32
|
+
include: # Builds based on the matrix below are added to this list
|
33
|
+
- rvm: "2.6.0"
|
34
|
+
gemfile: "gemfiles/no_dependencies.gemfile"
|
35
|
+
before_script: "" # Unset default: No need to install the extension
|
36
|
+
script:
|
37
|
+
- "./support/bundler_wrapper exec rake travis:validate"
|
38
|
+
- "./support/bundler_wrapper exec rubocop"
|
39
|
+
|
40
|
+
matrix:
|
41
|
+
defaults:
|
42
|
+
rubygems: "latest"
|
43
|
+
bundler: "latest"
|
44
|
+
|
45
|
+
gemsets: # By default all gems are tested
|
46
|
+
none:
|
47
|
+
- "no_dependencies"
|
48
|
+
minimal:
|
49
|
+
- "no_dependencies"
|
50
|
+
- "rails-4.2"
|
51
|
+
- "rails-5.2"
|
52
|
+
|
53
|
+
ruby:
|
54
|
+
- ruby: "2.0.0"
|
55
|
+
rubygems: "2.7.8"
|
56
|
+
- ruby: "2.1.8"
|
57
|
+
rubygems: "2.7.8"
|
58
|
+
gems: "none"
|
59
|
+
- ruby: "2.2.4"
|
60
|
+
rubygems: "2.7.8"
|
61
|
+
gems: "none"
|
62
|
+
- ruby: "2.3.8"
|
63
|
+
gems: "none"
|
64
|
+
- ruby: "2.4.5"
|
65
|
+
gems: "none"
|
66
|
+
- ruby: "2.5.3"
|
67
|
+
gems: "minimal"
|
68
|
+
- ruby: "2.6.0"
|
69
|
+
- ruby: "jruby-19mode"
|
70
|
+
gems: "minimal"
|
71
|
+
gems:
|
72
|
+
- gem: "no_dependencies"
|
73
|
+
- gem: "capistrano2"
|
74
|
+
- gem: "capistrano3"
|
75
|
+
- gem: "grape"
|
76
|
+
- gem: "padrino"
|
77
|
+
bundler: "1.17.3"
|
78
|
+
- gem: "que"
|
79
|
+
- gem: "rails-3.2"
|
80
|
+
bundler: "1.17.3"
|
81
|
+
exclude:
|
82
|
+
ruby:
|
83
|
+
- "2.6.0"
|
84
|
+
- gem: "rails-4.2"
|
85
|
+
bundler: "1.17.3"
|
86
|
+
exclude:
|
87
|
+
ruby:
|
88
|
+
- "2.6.0"
|
89
|
+
- gem: "rails-5.0"
|
90
|
+
exclude:
|
91
|
+
ruby:
|
92
|
+
- "2.0.0"
|
93
|
+
- gem: "rails-5.1"
|
94
|
+
exclude:
|
95
|
+
ruby:
|
96
|
+
- "2.0.0"
|
97
|
+
- gem: "rails-5.2"
|
98
|
+
exclude:
|
99
|
+
ruby:
|
100
|
+
- "2.0.0"
|
101
|
+
- gem: "resque"
|
102
|
+
bundler: "1.17.3"
|
103
|
+
- gem: "sequel"
|
104
|
+
- gem: "sequel-435"
|
105
|
+
- gem: "sinatra"
|
106
|
+
- gem: "webmachine"
|
@@ -81,9 +81,10 @@ module Appsignal
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
+
# Returns the AppSignal gem installation path. The root directory of
|
85
|
+
# this gem.
|
84
86
|
def gem_path
|
85
|
-
|
86
|
-
Bundler::CLI::Common.select_spec("appsignal").full_gem_path.strip
|
87
|
+
File.expand_path("../../../../../", __FILE__)
|
87
88
|
end
|
88
89
|
end
|
89
90
|
end
|
data/lib/appsignal/hooks.rb
CHANGED
@@ -65,25 +65,6 @@ module Appsignal
|
|
65
65
|
def truncate(text)
|
66
66
|
text.size > 200 ? "#{text[0...197]}..." : text
|
67
67
|
end
|
68
|
-
|
69
|
-
def extract_value(object_or_hash, field, default_value = nil, convert_to_s = false)
|
70
|
-
value =
|
71
|
-
if object_or_hash.respond_to?(:[])
|
72
|
-
begin
|
73
|
-
object_or_hash[field]
|
74
|
-
rescue NameError
|
75
|
-
nil
|
76
|
-
end
|
77
|
-
elsif object_or_hash.respond_to?(field)
|
78
|
-
object_or_hash.send(field)
|
79
|
-
end || default_value
|
80
|
-
|
81
|
-
if convert_to_s
|
82
|
-
value.to_s
|
83
|
-
else
|
84
|
-
value
|
85
|
-
end
|
86
|
-
end
|
87
68
|
end
|
88
69
|
end
|
89
70
|
end
|
@@ -53,6 +53,33 @@ module Appsignal
|
|
53
53
|
block.call(job)
|
54
54
|
end
|
55
55
|
end
|
56
|
+
|
57
|
+
def self.extract_value(object_or_hash, field, default_value = nil, convert_to_s = false)
|
58
|
+
value = nil
|
59
|
+
|
60
|
+
# Attempt to read value from hash
|
61
|
+
if object_or_hash.respond_to?(:[])
|
62
|
+
value = begin
|
63
|
+
object_or_hash[field]
|
64
|
+
rescue NameError
|
65
|
+
nil
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Attempt to read value from object
|
70
|
+
if value.nil? && object_or_hash.respond_to?(field)
|
71
|
+
value = object_or_hash.send(field)
|
72
|
+
end
|
73
|
+
|
74
|
+
# Set default value if nothing was found
|
75
|
+
value = default_value if value.nil?
|
76
|
+
|
77
|
+
if convert_to_s
|
78
|
+
value.to_s
|
79
|
+
else
|
80
|
+
value
|
81
|
+
end
|
82
|
+
end
|
56
83
|
end
|
57
84
|
end
|
58
85
|
end
|
data/lib/appsignal/version.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
require "bundler/cli"
|
2
|
+
require "bundler/cli/common"
|
3
|
+
require "appsignal/cli/diagnose/paths"
|
4
|
+
|
5
|
+
describe Appsignal::CLI::Diagnose::Paths do
|
6
|
+
describe "#paths" do
|
7
|
+
before { Appsignal.config = project_fixture_config }
|
8
|
+
|
9
|
+
it "returns gem installation path as package_install_path" do
|
10
|
+
expect(described_class.new.paths[:package_install_path]).to eq(
|
11
|
+
:label => "AppSignal gem path",
|
12
|
+
:path => Bundler::CLI::Common.select_spec("appsignal").full_gem_path.strip
|
13
|
+
)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "bundler/cli"
|
2
|
+
require "bundler/cli/common"
|
1
3
|
require "appsignal/cli"
|
2
4
|
|
3
5
|
describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_input do
|
@@ -1140,10 +1142,9 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
|
|
1140
1142
|
it_behaves_like "diagnose file" do
|
1141
1143
|
let(:filename) { File.join("ext", "install.log") }
|
1142
1144
|
before do
|
1143
|
-
|
1144
|
-
.with("appsignal")
|
1145
|
+
expect_any_instance_of(Appsignal::CLI::Diagnose::Paths).to receive(:gem_path)
|
1145
1146
|
.at_least(:once)
|
1146
|
-
.and_return(
|
1147
|
+
.and_return(parent_directory)
|
1147
1148
|
end
|
1148
1149
|
end
|
1149
1150
|
|
@@ -1157,10 +1158,9 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
|
|
1157
1158
|
it_behaves_like "diagnose file" do
|
1158
1159
|
let(:filename) { File.join("ext", "mkmf.log") }
|
1159
1160
|
before do
|
1160
|
-
|
1161
|
-
.with("appsignal")
|
1161
|
+
expect_any_instance_of(Appsignal::CLI::Diagnose::Paths).to receive(:gem_path)
|
1162
1162
|
.at_least(:once)
|
1163
|
-
.and_return(
|
1163
|
+
.and_return(parent_directory)
|
1164
1164
|
end
|
1165
1165
|
end
|
1166
1166
|
|
@@ -346,6 +346,143 @@ describe Appsignal::Hooks::DelayedJobHook do
|
|
346
346
|
end
|
347
347
|
end
|
348
348
|
end
|
349
|
+
|
350
|
+
describe ".extract_value" do
|
351
|
+
let(:plugin) { Appsignal::Hooks::DelayedJobPlugin }
|
352
|
+
|
353
|
+
context "for a hash" do
|
354
|
+
let(:hash) { { :key => "value", :bool_false => false } }
|
355
|
+
|
356
|
+
context "when the key exists" do
|
357
|
+
subject { plugin.extract_value(hash, :key) }
|
358
|
+
|
359
|
+
it { is_expected.to eq "value" }
|
360
|
+
|
361
|
+
context "when the value is false" do
|
362
|
+
subject { plugin.extract_value(hash, :bool_false) }
|
363
|
+
|
364
|
+
it { is_expected.to be false }
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
context "when the key does not exist" do
|
369
|
+
subject { plugin.extract_value(hash, :nonexistent_key) }
|
370
|
+
|
371
|
+
it { is_expected.to be_nil }
|
372
|
+
|
373
|
+
context "with a default value" do
|
374
|
+
subject { plugin.extract_value(hash, :nonexistent_key, 1) }
|
375
|
+
|
376
|
+
it { is_expected.to eq 1 }
|
377
|
+
end
|
378
|
+
end
|
379
|
+
end
|
380
|
+
|
381
|
+
context "for a struct" do
|
382
|
+
before :context do
|
383
|
+
TestStruct = Struct.new(:key)
|
384
|
+
end
|
385
|
+
let(:struct) { TestStruct.new("value") }
|
386
|
+
|
387
|
+
context "when the key exists" do
|
388
|
+
subject { plugin.extract_value(struct, :key) }
|
389
|
+
|
390
|
+
it { is_expected.to eq "value" }
|
391
|
+
end
|
392
|
+
|
393
|
+
context "when the key does not exist" do
|
394
|
+
subject { plugin.extract_value(struct, :nonexistent_key) }
|
395
|
+
|
396
|
+
it { is_expected.to be_nil }
|
397
|
+
|
398
|
+
context "with a default value" do
|
399
|
+
subject { plugin.extract_value(struct, :nonexistent_key, 1) }
|
400
|
+
|
401
|
+
it { is_expected.to eq 1 }
|
402
|
+
end
|
403
|
+
end
|
404
|
+
end
|
405
|
+
|
406
|
+
context "for a struct with a method" do
|
407
|
+
before :context do
|
408
|
+
class TestStructClass < Struct.new(:id) # rubocop:disable Style/StructInheritance
|
409
|
+
def appsignal_name
|
410
|
+
"TestStruct#perform"
|
411
|
+
end
|
412
|
+
|
413
|
+
def bool_false
|
414
|
+
false
|
415
|
+
end
|
416
|
+
end
|
417
|
+
end
|
418
|
+
let(:struct) { TestStructClass.new("id") }
|
419
|
+
|
420
|
+
context "when the Struct responds to a method" do
|
421
|
+
subject { plugin.extract_value(struct, :appsignal_name) }
|
422
|
+
|
423
|
+
it "returns the method value" do
|
424
|
+
is_expected.to eq "TestStruct#perform"
|
425
|
+
end
|
426
|
+
|
427
|
+
context "when the value is false" do
|
428
|
+
subject { plugin.extract_value(struct, :bool_false) }
|
429
|
+
|
430
|
+
it "returns the method value" do
|
431
|
+
is_expected.to be false
|
432
|
+
end
|
433
|
+
end
|
434
|
+
end
|
435
|
+
|
436
|
+
context "when the key does not exist" do
|
437
|
+
subject { plugin.extract_value(struct, :nonexistent_key) }
|
438
|
+
|
439
|
+
context "without a method with the same name" do
|
440
|
+
it "returns nil" do
|
441
|
+
is_expected.to be_nil
|
442
|
+
end
|
443
|
+
end
|
444
|
+
|
445
|
+
context "with a default value" do
|
446
|
+
let(:default_value) { :my_default_value }
|
447
|
+
subject { plugin.extract_value(struct, :nonexistent_key, default_value) }
|
448
|
+
|
449
|
+
it "returns the default value" do
|
450
|
+
is_expected.to eq default_value
|
451
|
+
end
|
452
|
+
end
|
453
|
+
end
|
454
|
+
end
|
455
|
+
|
456
|
+
context "for an object" do
|
457
|
+
let(:object) { double(:existing_method => "value") }
|
458
|
+
|
459
|
+
context "when the method exists" do
|
460
|
+
subject { plugin.extract_value(object, :existing_method) }
|
461
|
+
|
462
|
+
it { is_expected.to eq "value" }
|
463
|
+
end
|
464
|
+
|
465
|
+
context "when the method does not exist" do
|
466
|
+
subject { plugin.extract_value(object, :nonexistent_method) }
|
467
|
+
|
468
|
+
it { is_expected.to be_nil }
|
469
|
+
|
470
|
+
context "and there is a default value" do
|
471
|
+
subject { plugin.extract_value(object, :nonexistent_method, 1) }
|
472
|
+
|
473
|
+
it { is_expected.to eq 1 }
|
474
|
+
end
|
475
|
+
end
|
476
|
+
end
|
477
|
+
|
478
|
+
context "when we need to call to_s on the value" do
|
479
|
+
let(:object) { double(:existing_method => 1) }
|
480
|
+
|
481
|
+
subject { plugin.extract_value(object, :existing_method, nil, true) }
|
482
|
+
|
483
|
+
it { is_expected.to eq "1" }
|
484
|
+
end
|
485
|
+
end
|
349
486
|
end
|
350
487
|
|
351
488
|
context "without delayed job" do
|
@@ -113,83 +113,4 @@ describe Appsignal::Hooks::Helpers do
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
end
|
116
|
-
|
117
|
-
describe "#extract_value" do
|
118
|
-
context "for a hash" do
|
119
|
-
let(:hash) { { :key => "value" } }
|
120
|
-
|
121
|
-
context "when the key exists" do
|
122
|
-
subject { with_helpers.extract_value(hash, :key) }
|
123
|
-
|
124
|
-
it { is_expected.to eq "value" }
|
125
|
-
end
|
126
|
-
|
127
|
-
context "when the key does not exist" do
|
128
|
-
subject { with_helpers.extract_value(hash, :nonexistent_key) }
|
129
|
-
|
130
|
-
it { is_expected.to be_nil }
|
131
|
-
|
132
|
-
context "with a default value" do
|
133
|
-
subject { with_helpers.extract_value(hash, :nonexistent_key, 1) }
|
134
|
-
|
135
|
-
it { is_expected.to eq 1 }
|
136
|
-
end
|
137
|
-
end
|
138
|
-
end
|
139
|
-
|
140
|
-
context "for a struct" do
|
141
|
-
before :context do
|
142
|
-
TestStruct = Struct.new(:key)
|
143
|
-
end
|
144
|
-
let(:struct) { TestStruct.new("value") }
|
145
|
-
|
146
|
-
context "when the key exists" do
|
147
|
-
subject { with_helpers.extract_value(struct, :key) }
|
148
|
-
|
149
|
-
it { is_expected.to eq "value" }
|
150
|
-
end
|
151
|
-
|
152
|
-
context "when the key does not exist" do
|
153
|
-
subject { with_helpers.extract_value(struct, :nonexistent_key) }
|
154
|
-
|
155
|
-
it { is_expected.to be_nil }
|
156
|
-
|
157
|
-
context "with a default value" do
|
158
|
-
subject { with_helpers.extract_value(struct, :nonexistent_key, 1) }
|
159
|
-
|
160
|
-
it { is_expected.to eq 1 }
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
context "for an object" do
|
166
|
-
let(:object) { double(:existing_method => "value") }
|
167
|
-
|
168
|
-
context "when the method exists" do
|
169
|
-
subject { with_helpers.extract_value(object, :existing_method) }
|
170
|
-
|
171
|
-
it { is_expected.to eq "value" }
|
172
|
-
end
|
173
|
-
|
174
|
-
context "when the method does not exist" do
|
175
|
-
subject { with_helpers.extract_value(object, :nonexistent_method) }
|
176
|
-
|
177
|
-
it { is_expected.to be_nil }
|
178
|
-
|
179
|
-
context "and there is a default value" do
|
180
|
-
subject { with_helpers.extract_value(object, :nonexistent_method, 1) }
|
181
|
-
|
182
|
-
it { is_expected.to eq 1 }
|
183
|
-
end
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
context "when we need to call to_s on the value" do
|
188
|
-
let(:object) { double(:existing_method => 1) }
|
189
|
-
|
190
|
-
subject { with_helpers.extract_value(object, :existing_method, nil, true) }
|
191
|
-
|
192
|
-
it { is_expected.to eq "1" }
|
193
|
-
end
|
194
|
-
end
|
195
116
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -eu
|
4
|
+
|
5
|
+
case "${_RUBYGEMS_VERSION-"latest"}" in
|
6
|
+
"latest")
|
7
|
+
gem update --no-document --system
|
8
|
+
;;
|
9
|
+
*)
|
10
|
+
gem update --no-document --system $_RUBYGEMS_VERSION
|
11
|
+
;;
|
12
|
+
esac
|
13
|
+
|
14
|
+
case "${_BUNDLER_VERSION-"latest"}" in
|
15
|
+
"latest")
|
16
|
+
gem update bundler --no-document
|
17
|
+
;;
|
18
|
+
*)
|
19
|
+
gem install bundler --no-document --version $_BUNDLER_VERSION
|
20
|
+
;;
|
21
|
+
esac
|
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.8.
|
4
|
+
version: 2.8.2
|
5
5
|
platform: ruby
|
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:
|
12
|
+
date: 2019-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -146,6 +146,7 @@ files:
|
|
146
146
|
- appsignal.gemspec
|
147
147
|
- benchmark.rake
|
148
148
|
- bin/appsignal
|
149
|
+
- build_matrix.yml
|
149
150
|
- ext/Rakefile
|
150
151
|
- ext/agent.yml
|
151
152
|
- ext/appsignal_extension.c
|
@@ -163,6 +164,7 @@ files:
|
|
163
164
|
- gemfiles/rails-4.2.gemfile
|
164
165
|
- gemfiles/rails-5.0.gemfile
|
165
166
|
- gemfiles/rails-5.1.gemfile
|
167
|
+
- gemfiles/rails-5.2.gemfile
|
166
168
|
- gemfiles/resque.gemfile
|
167
169
|
- gemfiles/sequel-435.gemfile
|
168
170
|
- gemfiles/sequel.gemfile
|
@@ -251,6 +253,7 @@ files:
|
|
251
253
|
- spec/lib/appsignal/capistrano2_spec.rb
|
252
254
|
- spec/lib/appsignal/capistrano3_spec.rb
|
253
255
|
- spec/lib/appsignal/cli/demo_spec.rb
|
256
|
+
- spec/lib/appsignal/cli/diagnose/paths_spec.rb
|
254
257
|
- spec/lib/appsignal/cli/diagnose/utils_spec.rb
|
255
258
|
- spec/lib/appsignal/cli/diagnose_spec.rb
|
256
259
|
- spec/lib/appsignal/cli/helpers_spec.rb
|
@@ -348,6 +351,8 @@ files:
|
|
348
351
|
- spec/support/rails/my_app.rb
|
349
352
|
- spec/support/shared_examples/instrument.rb
|
350
353
|
- spec/support/stubs/delayed_job.rb
|
354
|
+
- support/bundler_wrapper
|
355
|
+
- support/install_deps
|
351
356
|
homepage: https://github.com/appsignal/appsignal-ruby
|
352
357
|
licenses:
|
353
358
|
- MIT
|
@@ -368,7 +373,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
368
373
|
- !ruby/object:Gem::Version
|
369
374
|
version: '0'
|
370
375
|
requirements: []
|
371
|
-
rubygems_version: 3.0.
|
376
|
+
rubygems_version: 3.0.2
|
372
377
|
signing_key:
|
373
378
|
specification_version: 4
|
374
379
|
summary: Logs performance and exception data from your app to appsignal.com
|
@@ -378,6 +383,7 @@ test_files:
|
|
378
383
|
- spec/lib/appsignal/capistrano2_spec.rb
|
379
384
|
- spec/lib/appsignal/capistrano3_spec.rb
|
380
385
|
- spec/lib/appsignal/cli/demo_spec.rb
|
386
|
+
- spec/lib/appsignal/cli/diagnose/paths_spec.rb
|
381
387
|
- spec/lib/appsignal/cli/diagnose/utils_spec.rb
|
382
388
|
- spec/lib/appsignal/cli/diagnose_spec.rb
|
383
389
|
- spec/lib/appsignal/cli/helpers_spec.rb
|