appsignal 2.1.2 → 2.2.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +14 -0
  3. data/.rubocop_todo.yml +16 -171
  4. data/.travis.yml +14 -1
  5. data/.yardopts +8 -0
  6. data/CHANGELOG.md +21 -3
  7. data/README.md +20 -2
  8. data/Rakefile +60 -62
  9. data/appsignal.gemspec +24 -23
  10. data/ext/agent.yml +11 -11
  11. data/ext/appsignal_extension.c +43 -12
  12. data/ext/extconf.rb +9 -9
  13. data/gemfiles/padrino.gemfile +1 -1
  14. data/lib/appsignal.rb +403 -26
  15. data/lib/appsignal/auth_check.rb +28 -1
  16. data/lib/appsignal/cli.rb +1 -0
  17. data/lib/appsignal/cli/demo.rb +40 -0
  18. data/lib/appsignal/cli/diagnose.rb +345 -89
  19. data/lib/appsignal/cli/helpers.rb +9 -4
  20. data/lib/appsignal/cli/install.rb +6 -6
  21. data/lib/appsignal/cli/notify_of_deploy.rb +58 -0
  22. data/lib/appsignal/config.rb +40 -38
  23. data/lib/appsignal/demo.rb +20 -0
  24. data/lib/appsignal/event_formatter.rb +4 -0
  25. data/lib/appsignal/event_formatter/action_view/render_formatter.rb +1 -0
  26. data/lib/appsignal/event_formatter/active_record/instantiation_formatter.rb +1 -0
  27. data/lib/appsignal/event_formatter/active_record/sql_formatter.rb +1 -0
  28. data/lib/appsignal/event_formatter/elastic_search/search_formatter.rb +1 -0
  29. data/lib/appsignal/event_formatter/faraday/request_formatter.rb +1 -0
  30. data/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter.rb +2 -1
  31. data/lib/appsignal/event_formatter/moped/query_formatter.rb +1 -0
  32. data/lib/appsignal/extension.rb +1 -0
  33. data/lib/appsignal/garbage_collection_profiler.rb +20 -19
  34. data/lib/appsignal/hooks.rb +1 -0
  35. data/lib/appsignal/hooks/active_support_notifications.rb +1 -0
  36. data/lib/appsignal/hooks/celluloid.rb +1 -0
  37. data/lib/appsignal/hooks/data_mapper.rb +1 -0
  38. data/lib/appsignal/hooks/delayed_job.rb +1 -0
  39. data/lib/appsignal/hooks/mongo_ruby_driver.rb +1 -0
  40. data/lib/appsignal/hooks/net_http.rb +1 -0
  41. data/lib/appsignal/hooks/passenger.rb +1 -0
  42. data/lib/appsignal/hooks/puma.rb +1 -0
  43. data/lib/appsignal/hooks/rake.rb +1 -0
  44. data/lib/appsignal/hooks/redis.rb +1 -0
  45. data/lib/appsignal/hooks/sequel.rb +1 -0
  46. data/lib/appsignal/hooks/shoryuken.rb +1 -0
  47. data/lib/appsignal/hooks/sidekiq.rb +1 -0
  48. data/lib/appsignal/hooks/unicorn.rb +1 -0
  49. data/lib/appsignal/hooks/webmachine.rb +1 -0
  50. data/lib/appsignal/integrations/capistrano/appsignal.cap +4 -4
  51. data/lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb +2 -0
  52. data/lib/appsignal/integrations/data_mapper.rb +1 -1
  53. data/lib/appsignal/integrations/delayed_job_plugin.rb +1 -0
  54. data/lib/appsignal/integrations/grape.rb +3 -1
  55. data/lib/appsignal/integrations/mongo_ruby_driver.rb +1 -0
  56. data/lib/appsignal/integrations/padrino.rb +36 -21
  57. data/lib/appsignal/integrations/railtie.rb +2 -2
  58. data/lib/appsignal/integrations/resque.rb +1 -0
  59. data/lib/appsignal/integrations/resque_active_job.rb +1 -0
  60. data/lib/appsignal/integrations/webmachine.rb +27 -24
  61. data/lib/appsignal/js_exception_transaction.rb +8 -8
  62. data/lib/appsignal/marker.rb +41 -4
  63. data/lib/appsignal/minutely.rb +1 -0
  64. data/lib/appsignal/rack/generic_instrumentation.rb +3 -2
  65. data/lib/appsignal/rack/js_exception_catcher.rb +55 -15
  66. data/lib/appsignal/rack/rails_instrumentation.rb +2 -1
  67. data/lib/appsignal/rack/sinatra_instrumentation.rb +4 -2
  68. data/lib/appsignal/rack/streaming_listener.rb +4 -2
  69. data/lib/appsignal/system.rb +5 -31
  70. data/lib/appsignal/transaction.rb +71 -6
  71. data/lib/appsignal/transmitter.rb +24 -13
  72. data/lib/appsignal/utils.rb +18 -11
  73. data/lib/appsignal/utils/params_sanitizer.rb +2 -1
  74. data/lib/appsignal/utils/query_params_sanitizer.rb +1 -0
  75. data/lib/appsignal/version.rb +1 -1
  76. data/resources/appsignal.yml.erb +1 -1
  77. data/spec/lib/appsignal/auth_check_spec.rb +64 -22
  78. data/spec/lib/appsignal/cli/diagnose_spec.rb +539 -81
  79. data/spec/lib/appsignal/cli/helpers_spec.rb +74 -2
  80. data/spec/lib/appsignal/cli/install_spec.rb +3 -3
  81. data/spec/lib/appsignal/config_spec.rb +38 -72
  82. data/spec/lib/appsignal/demo_spec.rb +2 -2
  83. data/spec/lib/appsignal/event_formatter_spec.rb +2 -2
  84. data/spec/lib/appsignal/extension_spec.rb +4 -0
  85. data/spec/lib/appsignal/garbage_collection_profiler_spec.rb +18 -21
  86. data/spec/lib/appsignal/hooks/mongo_ruby_driver_spec.rb +1 -1
  87. data/spec/lib/appsignal/hooks/redis_spec.rb +34 -44
  88. data/spec/lib/appsignal/hooks/sidekiq_spec.rb +2 -2
  89. data/spec/lib/appsignal/integrations/grape_spec.rb +6 -6
  90. data/spec/lib/appsignal/integrations/padrino_spec.rb +241 -122
  91. data/spec/lib/appsignal/integrations/railtie_spec.rb +34 -16
  92. data/spec/lib/appsignal/integrations/resque_spec.rb +1 -1
  93. data/spec/lib/appsignal/integrations/sinatra_spec.rb +38 -10
  94. data/spec/lib/appsignal/integrations/webmachine_spec.rb +2 -2
  95. data/spec/lib/appsignal/rack/generic_instrumentation_spec.rb +7 -6
  96. data/spec/lib/appsignal/rack/js_exception_catcher_spec.rb +95 -58
  97. data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +9 -6
  98. data/spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb +11 -10
  99. data/spec/lib/appsignal/rack/streaming_listener_spec.rb +20 -13
  100. data/spec/lib/appsignal/system_spec.rb +2 -32
  101. data/spec/lib/appsignal/transaction_spec.rb +48 -7
  102. data/spec/lib/appsignal/transmitter_spec.rb +52 -33
  103. data/spec/lib/appsignal/utils/params_sanitizer_spec.rb +3 -1
  104. data/spec/lib/appsignal/utils/query_params_sanitizer_spec.rb +3 -3
  105. data/spec/lib/appsignal/utils_spec.rb +49 -6
  106. data/spec/lib/appsignal_spec.rb +60 -5
  107. data/spec/spec_helper.rb +4 -3
  108. data/spec/support/helpers/api_request_helper.rb +1 -4
  109. data/spec/support/helpers/dependency_helper.rb +4 -0
  110. data/spec/support/helpers/system_helpers.rb +1 -17
  111. data/spec/support/helpers/time_helpers.rb +1 -1
  112. metadata +19 -8
  113. data/spec/lib/appsignal/system/container_spec.rb +0 -67
  114. data/spec/lib/appsignal/utils/gzip_spec.rb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e046fb025d367006e6b7917b5cbf63bfd592271d
4
- data.tar.gz: a2cc0879ae2f6386ab860e17d78914428babd5a9
3
+ metadata.gz: 57f576bab6bcb116a443d5ba191d9b76d8451654
4
+ data.tar.gz: c87e7167c5ccf4cc00b3948776cc0c12ffea3644
5
5
  SHA512:
6
- metadata.gz: 1d99afd1e739b01f82e575c0237afea2a2c4cace49e2634b9c1965c16eaea09f4bac37d31c24bba2a4454cc70256922431cd11dd3828653ffddcc14214fea39c
7
- data.tar.gz: aee0fbbb44af79823ca0cb68f5801e58d1302aa0e6158bfbe165887dd0db94ef83789ff265fe24a5c8e49808c33fc5718b60953460530fe476688321021fc9a0
6
+ metadata.gz: ddd3744e790d81d79d11e7b3a0312f0aa352a3db48722c243438cf39021c6d37f7b0d83a62a74d36bb3bd55c476c9cae310fe51f3e49862c923885621c41e010
7
+ data.tar.gz: 89c2d0c9c12deca8051569a2f646d9091abcc280e5dc6b6b7c02f91642483b671465a9c36017826fa31df170a25f094ea0c1bf7a4f2ae411e7146b43d676f3e9
@@ -3,7 +3,10 @@ inherit_from: .rubocop_todo.yml
3
3
  AllCops:
4
4
  TargetRubyVersion: 1.9
5
5
  Include:
6
+ - "**/*.cap"
6
7
  - "Gemfile"
8
+ - "Rakefile"
9
+ - "appsignal.gemspec"
7
10
  Exclude:
8
11
  - "tmp/**/*"
9
12
  - "gemfiles/vendor/**/*"
@@ -39,5 +42,16 @@ Style/AlignHash:
39
42
  Style/IndentArray:
40
43
  EnforcedStyle: consistent
41
44
 
45
+ Style/EmptyMethod:
46
+ EnforcedStyle: expanded
47
+
48
+ Style/MethodMissing:
49
+ Exclude:
50
+ - "lib/appsignal/extension.rb"
51
+ - "lib/appsignal/transaction.rb"
52
+
53
+ Style/TrailingUnderscoreVariable:
54
+ Enabled: false
55
+
42
56
  # Metrics/LineLength:
43
57
  # Max: 80
@@ -1,18 +1,11 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2016-12-27 13:45:00 +0100 using RuboCop version 0.46.0.
3
+ # on 2017-04-06 22:15:48 +0200 using RuboCop version 0.46.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: 6
10
- # Configuration parameters: AllowSafeAssignment.
11
- Lint/AssignmentInCondition:
12
- Exclude:
13
- - 'lib/appsignal/config.rb'
14
- - 'lib/appsignal/transaction.rb'
15
-
16
9
  # Offense count: 7
17
10
  Lint/HandleExceptions:
18
11
  Exclude:
@@ -21,29 +14,17 @@ Lint/HandleExceptions:
21
14
  - 'spec/lib/appsignal/hooks/sidekiq_spec.rb'
22
15
  - 'spec/lib/appsignal/integrations/resque_spec.rb'
23
16
 
24
- # Offense count: 1
25
- Lint/IneffectiveAccessModifier:
26
- Exclude:
27
- - 'lib/appsignal/garbage_collection_profiler.rb'
28
-
29
17
  # Offense count: 4
30
18
  Lint/RescueException:
31
19
  Exclude:
32
20
  - 'lib/appsignal/minutely.rb'
33
21
  - 'lib/appsignal/rack/streaming_listener.rb'
34
22
 
35
- # Offense count: 3
36
- # Cop supports --auto-correct.
37
- Lint/UnifiedInteger:
38
- Exclude:
39
- - 'lib/appsignal/utils.rb'
40
- - 'lib/appsignal/utils/params_sanitizer.rb'
41
-
42
- # Offense count: 36
23
+ # Offense count: 38
43
24
  Metrics/AbcSize:
44
- Max: 59
25
+ Max: 61
45
26
 
46
- # Offense count: 2
27
+ # Offense count: 3
47
28
  # Configuration parameters: CountComments.
48
29
  Metrics/BlockLength:
49
30
  Max: 31
@@ -51,19 +32,23 @@ Metrics/BlockLength:
51
32
  # Offense count: 4
52
33
  # Configuration parameters: CountComments.
53
34
  Metrics/ClassLength:
54
- Max: 263
35
+ Exclude:
36
+ - "lib/appsignal/cli/diagnose.rb"
37
+ - "lib/appsignal/cli/install.rb"
38
+ - "lib/appsignal/config.rb"
39
+ - "lib/appsignal/transaction.rb"
55
40
 
56
- # Offense count: 14
41
+ # Offense count: 15
57
42
  Metrics/CyclomaticComplexity:
58
43
  Max: 11
59
44
 
60
- # Offense count: 378
45
+ # Offense count: 437
61
46
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
62
47
  # URISchemes: http, https
63
48
  Metrics/LineLength:
64
49
  Max: 456
65
50
 
66
- # Offense count: 77
51
+ # Offense count: 79
67
52
  # Configuration parameters: CountComments.
68
53
  Metrics/MethodLength:
69
54
  Max: 60
@@ -74,11 +59,11 @@ Metrics/ModuleLength:
74
59
  Exclude:
75
60
  - "lib/appsignal.rb"
76
61
 
77
- # Offense count: 8
62
+ # Offense count: 9
78
63
  Metrics/PerceivedComplexity:
79
- Max: 15
64
+ Max: 14
80
65
 
81
- # Offense count: 7
66
+ # Offense count: 11
82
67
  Style/AccessorMethodName:
83
68
  Exclude:
84
69
  - 'lib/appsignal.rb'
@@ -103,20 +88,11 @@ Style/Alias:
103
88
  - 'lib/appsignal/transaction.rb'
104
89
 
105
90
  # Offense count: 1
106
- # Cop supports --auto-correct.
107
- # Configuration parameters: EnforcedStyle, SupportedStyles.
108
- # SupportedStyles: always, conditionals
109
- Style/AndOr:
110
- Exclude:
111
- - 'lib/appsignal.rb'
112
-
113
- # Offense count: 3
114
91
  # Configuration parameters: EnforcedStyle, SupportedStyles.
115
92
  # SupportedStyles: nested, compact
116
93
  Style/ClassAndModuleChildren:
117
94
  Exclude:
118
95
  - 'lib/appsignal/integrations/padrino.rb'
119
- - 'lib/appsignal/integrations/webmachine.rb'
120
96
 
121
97
  # Offense count: 3
122
98
  Style/ClassVars:
@@ -129,20 +105,6 @@ Style/DoubleNegation:
129
105
  Exclude:
130
106
  - 'lib/appsignal.rb'
131
107
 
132
- # Offense count: 9
133
- # Cop supports --auto-correct.
134
- # Configuration parameters: EnforcedStyle, SupportedStyles.
135
- # SupportedStyles: compact, expanded
136
- Style/EmptyMethod:
137
- Exclude:
138
- - 'lib/appsignal/transaction.rb'
139
- - 'spec/lib/appsignal/event_formatter_spec.rb'
140
- - 'spec/lib/appsignal/hooks/mongo_ruby_driver_spec.rb'
141
- - 'spec/lib/appsignal/hooks/puma_spec.rb'
142
- - 'spec/lib/appsignal/hooks/unicorn_spec.rb'
143
- - 'spec/lib/appsignal/integrations/data_mapper_spec.rb'
144
- - 'spec/lib/appsignal/integrations/resque_active_job_spec.rb'
145
-
146
108
  # Offense count: 5
147
109
  # Configuration parameters: MinBodyLength.
148
110
  Style/GuardClause:
@@ -153,47 +115,12 @@ Style/GuardClause:
153
115
  - 'lib/appsignal/hooks.rb'
154
116
  - 'lib/appsignal/marker.rb'
155
117
 
156
- # Offense count: 3
118
+ # Offense count: 2
157
119
  # Cop supports --auto-correct.
158
120
  # Configuration parameters: MaxLineLength.
159
121
  Style/IfUnlessModifier:
160
122
  Exclude:
161
123
  - 'lib/appsignal.rb'
162
- - 'lib/appsignal/garbage_collection_profiler.rb'
163
-
164
- # Offense count: 2
165
- Style/MethodMissing:
166
- Exclude:
167
- - 'lib/appsignal/extension.rb'
168
- - 'lib/appsignal/transaction.rb'
169
-
170
- # Offense count: 1
171
- # Cop supports --auto-correct.
172
- Style/MultilineIfModifier:
173
- Exclude:
174
- - 'lib/appsignal/js_exception_transaction.rb'
175
-
176
- # Offense count: 9
177
- # Cop supports --auto-correct.
178
- Style/MutableConstant:
179
- Exclude:
180
- - 'ext/extconf.rb'
181
- - 'lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter.rb'
182
- - 'lib/appsignal/integrations/data_mapper.rb'
183
- - 'lib/appsignal/marker.rb'
184
- - 'lib/appsignal/transaction.rb'
185
- - 'lib/appsignal/transmitter.rb'
186
- - 'lib/appsignal/version.rb'
187
- - 'spec/lib/appsignal/hooks/mongo_ruby_driver_spec.rb'
188
- - 'spec/lib/appsignal/hooks/redis_spec.rb'
189
-
190
- # Offense count: 1
191
- # Cop supports --auto-correct.
192
- # Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles.
193
- # SupportedStyles: skip_modifier_ifs, always
194
- Style/Next:
195
- Exclude:
196
- - 'ext/extconf.rb'
197
124
 
198
125
  # Offense count: 1
199
126
  # Cop supports --auto-correct.
@@ -202,88 +129,6 @@ Style/NonNilCheck:
202
129
  Exclude:
203
130
  - 'lib/appsignal/transaction.rb'
204
131
 
205
- # Offense count: 20
206
- # Cop supports --auto-correct.
207
- # Configuration parameters: EnforcedOctalStyle, SupportedOctalStyles.
208
- # SupportedOctalStyles: zero_with_o, zero_only
209
- Style/NumericLiteralPrefix:
210
- Exclude:
211
- - 'ext/extconf.rb'
212
- - 'spec/lib/appsignal/cli/diagnose_spec.rb'
213
- - 'spec/lib/appsignal/config_spec.rb'
214
- - 'spec/lib/appsignal/system/container_spec.rb'
215
- - 'spec/lib/appsignal/transmitter_spec.rb'
216
- - 'spec/lib/appsignal_spec.rb'
217
- - 'spec/support/helpers/time_helpers.rb'
218
-
219
- # Offense count: 1
220
- # Cop supports --auto-correct.
221
- # Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
222
- # SupportedStyles: predicate, comparison
223
- Style/NumericPredicate:
224
- Exclude:
225
- - 'spec/**/*'
226
- - 'lib/appsignal/cli/diagnose.rb'
227
-
228
- # Offense count: 2
229
- # Cop supports --auto-correct.
230
- Style/PerlBackrefs:
231
- Exclude:
232
- - 'lib/appsignal/system.rb'
233
-
234
- # Offense count: 2
235
- # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
236
- # NamePrefix: is_, has_, have_
237
- # NamePrefixBlacklist: is_, has_, have_
238
- # NameWhitelist: is_a?
239
- Style/PredicateName:
240
- Exclude:
241
- - 'spec/**/*'
242
- - 'lib/appsignal.rb'
243
-
244
- # Offense count: 2
245
- # Cop supports --auto-correct.
246
- # Configuration parameters: EnforcedStyle, SupportedStyles.
247
- # SupportedStyles: compact, exploded
248
- Style/RaiseArgs:
249
- Exclude:
250
- - 'lib/appsignal/utils.rb'
251
- - 'spec/lib/appsignal/integrations/resque_spec.rb'
252
-
253
- # Offense count: 7
254
- # Cop supports --auto-correct.
255
- Style/RescueModifier:
256
- Exclude:
257
- - 'spec/lib/appsignal/integrations/padrino_spec.rb'
258
- - 'spec/lib/appsignal/rack/generic_instrumentation_spec.rb'
259
- - 'spec/lib/appsignal/rack/rails_instrumentation_spec.rb'
260
- - 'spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb'
261
- - 'spec/lib/appsignal/rack/streaming_listener_spec.rb'
262
-
263
- # Offense count: 2
264
- # Cop supports --auto-correct.
265
- # Configuration parameters: EnforcedStyle, SupportedStyles.
266
- # SupportedStyles: use_perl_names, use_english_names
267
- Style/SpecialGlobalVars:
268
- Exclude:
269
- - 'lib/appsignal.rb'
270
- - 'lib/appsignal/config.rb'
271
-
272
- # Offense count: 1
273
- # Cop supports --auto-correct.
274
- Style/UnlessElse:
275
- Exclude:
276
- - 'lib/appsignal.rb'
277
-
278
- # Offense count: 16
279
- # Cop supports --auto-correct.
280
- # Configuration parameters: EnforcedStyle, SupportedStyles, MinSize, WordRegex.
281
- # SupportedStyles: percent, brackets
282
132
  Style/WordArray:
283
133
  Exclude:
284
- - 'lib/appsignal/cli/install.rb'
285
- - 'spec/lib/appsignal/config_spec.rb'
286
134
  - 'spec/lib/appsignal/hooks/shoryuken_spec.rb'
287
- - 'spec/lib/appsignal/hooks/sidekiq_spec.rb'
288
- - 'spec/lib/appsignal/transaction_spec.rb'
289
- - 'spec/lib/appsignal/utils/query_params_sanitizer_spec.rb'
@@ -13,6 +13,7 @@ rvm:
13
13
  - "2.1.8"
14
14
  - "2.2.4"
15
15
  - "2.3.0"
16
+ - "2.4.0"
16
17
  - "jruby-19mode"
17
18
 
18
19
  gemfile:
@@ -46,10 +47,22 @@ matrix:
46
47
  gemfile: "gemfiles/rails-5.0.gemfile"
47
48
  allow_failures:
48
49
  - rvm: "jruby-19mode"
50
+ - rvm: "2.4.0"
51
+ gemfile: "gemfiles/rails-4.0.gemfile"
52
+ - rvm: "2.4.0"
53
+ gemfile: "gemfiles/rails-4.1.gemfile"
54
+ - rvm: "2.4.0"
55
+ gemfile: "gemfiles/rails-4.2.gemfile"
56
+ - rvm: "2.4.0"
57
+ gemfile: "gemfiles/resque.gemfile"
49
58
 
50
59
  env:
51
60
  global: "RAILS_ENV=test"
52
61
 
53
- before_script: "bundle exec rake extension:install"
62
+ before_install:
63
+ - "gem update --system"
64
+ - "gem update bundler"
65
+ before_script:
66
+ - "bundle exec rake extension:install"
54
67
 
55
68
  script: "bundle exec rake test"
@@ -0,0 +1,8 @@
1
+ --protected
2
+ --no-private
3
+ --output-dir doc
4
+ --markup markdown
5
+ -
6
+ CHANGELOG.md
7
+ LICENSE
8
+ README.md
@@ -1,11 +1,29 @@
1
+ # 2.2.0
2
+ * Support Ruby 2.4 better. PR #234
3
+ * Initial setup for documenting the Ruby gem's code. PR #243
4
+ * Move `running_in_container` auto detection to extension for easy reuse.
5
+ PR #249
6
+ * Allow overriding of action and namespace for a transaction. PR #254
7
+ * Prefix all agent configuration environment variables with an underscore to
8
+ separate the two usages. PR #258
9
+ * Force agent to run in diagnostic mode even when the user config is set to
10
+ `active: false`. PR #260
11
+ * Stub JS error catching endpoint when not active. PR #263
12
+ * Use better event names for Padrino integration. PR #265
13
+ * No longer gzip payloads send by the Ruby gem transmitter. PR #269
14
+ * Send diagnostics data report to AppSignal on request. PR #270
15
+ * When JS exception endpoint payload is empty return 400 code. PR #271
16
+ * Remove hardcoded DNS servers from agent and add config option. PR #278
17
+
1
18
  # 2.1.2
2
19
  * Fix error with Grape request methods defined with symbols. PR #259
3
20
 
4
21
  # 2.1.1
5
- * Fix DNS issue related to musl build.
6
- Commit 732c877de8faceabe8a977bf80a82a6a89065c4d
22
+ * Fix DNS issue related to the musl build.
23
+ Commit 732c877de8faceabe8a977bf80a82a6a89065c4d and
24
+ 84e521d20d4438f7b1dda82d5e9f1f533ae27c4b
7
25
  * Update benchmark and add load test. PR #248
8
- * Fix configuring instrument redis and sequel from env. PR #257
26
+ * Fix configuring instrument Redis and Sequel from env. PR #257
9
27
 
10
28
  # 2.1.0
11
29
  * Add support for musl based libc (Alpine Linux). PR #229
data/README.md CHANGED
@@ -160,11 +160,29 @@ systems][supported-systems] page.
160
160
  Make sure you have Bundler installed and then use the Rake install task to
161
161
  install all possible dependencies.
162
162
 
163
- ```
163
+ ```bash
164
+ # Install Bundler
164
165
  gem install bundler
165
- rake install
166
+ # Install the AppSignal extension and _all_ gems we support.
167
+ bundle exec rake install
168
+ # Only install the AppSignal extension.
169
+ bundle exec rake extension:install
170
+ ```
171
+
172
+ ### Testing
173
+
174
+ ```bash
175
+ bundle exec rspec
176
+ # Or with one file
177
+ bundle exec rspec spec/lib/appsignal_spec.rb
166
178
  ```
167
179
 
180
+ Note that some specs depend on certain other gems to run and if they are not
181
+ loaded RSpec will not run them. See also [Testing with other
182
+ gems](#testing-with-other-gems).
183
+
184
+ #### Testing with other gems
185
+
168
186
  AppSignal runs in many different configurations. To replicate these
169
187
  configurations you need to run the spec suite with a specific Gemfile.
170
188
 
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- require 'bundler'
1
+ require "bundler"
2
2
 
3
3
  GEMFILES = %w(
4
4
  capistrano2
@@ -17,50 +17,49 @@ GEMFILES = %w(
17
17
  sinatra
18
18
  grape
19
19
  webmachine
20
- )
20
+ ).freeze
21
21
 
22
22
  RUBY_VERSIONS = %w(
23
23
  2.0.0-p648
24
24
  2.1.8
25
25
  2.2.4
26
26
  2.3.0
27
- )
27
+ 2.4.0
28
+ ).freeze
28
29
 
29
30
  EXCLUSIONS = {
30
- 'rails-5.0' => %w(2.0.0 2.1.8)
31
- }
31
+ "rails-5.0" => %w(2.0.0 2.1.8)
32
+ }.freeze
32
33
 
33
34
  VERSION_MANAGERS = {
34
- :rbenv => lambda { |version| "rbenv local #{version}" },
35
- :rvm => lambda { |version| "rvm use --default #{version.split('-').first}" }
36
- }
35
+ :rbenv => ->(version) { "rbenv local #{version}" },
36
+ :rvm => ->(version) { "rvm use --default #{version.split("-").first}" }
37
+ }.freeze
37
38
 
38
39
  task :publish do
39
- require 'appsignal/version'
40
+ require "appsignal/version"
40
41
 
41
- NAME = 'appsignal'
42
- VERSION_FILE = 'lib/appsignal/version.rb'
43
- CHANGELOG_FILE = 'CHANGELOG.md'
42
+ NAME = "appsignal".freeze
43
+ VERSION_FILE = "lib/appsignal/version.rb".freeze
44
+ CHANGELOG_FILE = "CHANGELOG.md".freeze
44
45
 
45
- raise '$EDITOR should be set' unless ENV['EDITOR']
46
+ raise "$EDITOR should be set" unless ENV["EDITOR"]
46
47
 
47
48
  def build_and_push_gem
48
- puts '# Building gem'
49
+ puts "# Building gem"
49
50
  puts `gem build #{NAME}.gemspec`
50
- puts '# Publishing Gem'
51
+ puts "# Publishing Gem"
51
52
  puts `gem push #{NAME}-#{gem_version}.gem`
52
53
  end
53
54
 
54
55
  def create_and_push_tag
55
- begin
56
- puts `git commit -am 'Bump to #{version} [ci skip]'`
57
- puts "# Creating tag #{version}"
58
- puts `git tag #{version}`
59
- puts `git push origin #{version}`
60
- puts `git push origin #{current_branch}`
61
- rescue
62
- raise "Tag: '#{version}' already exists"
63
- end
56
+ puts `git commit -am 'Bump to #{version} [ci skip]'`
57
+ puts "# Creating tag #{version}"
58
+ puts `git tag #{version}`
59
+ puts `git push origin #{version}`
60
+ puts `git push origin #{current_branch}`
61
+ rescue
62
+ raise "Tag: '#{version}' already exists"
64
63
  end
65
64
 
66
65
  def changes
@@ -72,7 +71,7 @@ task :publish do
72
71
  end
73
72
 
74
73
  def version
75
- @version ||= 'v' << gem_version
74
+ @version ||= "v#{gem_version}"
76
75
  end
77
76
 
78
77
  def current_branch
@@ -80,24 +79,24 @@ task :publish do
80
79
  end
81
80
 
82
81
  def git_status_to_array(changes)
83
- changes.split("\n").each { |change| change.gsub!(/^.. /,'') }
82
+ changes.split("\n").each { |change| change.gsub!(/^.. /, "") }
84
83
  end
85
84
 
86
85
  raise "Branch should hold no uncommitted file change)" unless changes.empty?
87
86
 
88
87
  system("$EDITOR #{VERSION_FILE}")
89
- if changes.member?(VERSION_FILE)
90
- Appsignal.send(:remove_const, :VERSION)
91
- load File.expand_path(VERSION_FILE)
92
- system("$EDITOR #{CHANGELOG_FILE}")
93
- build_and_push_gem
94
- create_and_push_tag
95
- else
88
+ unless changes.member?(VERSION_FILE)
96
89
  raise "Actually change the version in: #{VERSION_FILE}"
97
90
  end
91
+
92
+ Appsignal.send(:remove_const, :VERSION)
93
+ load File.expand_path(VERSION_FILE)
94
+ system("$EDITOR #{CHANGELOG_FILE}")
95
+ build_and_push_gem
96
+ create_and_push_tag
98
97
  end
99
98
 
100
- desc 'Install the AppSignal gem, extension and all possible dependencies.'
99
+ desc "Install the AppSignal gem, extension and all possible dependencies."
101
100
  task :install => "extension:install" do
102
101
  Bundler.with_clean_env do
103
102
  GEMFILES.each do |gemfile|
@@ -110,7 +109,7 @@ task :spec_all_gemfiles do
110
109
  GEMFILES.each do |gemfile|
111
110
  puts "Running tests for #{gemfile}"
112
111
  unless system("env BUNDLE_GEMFILE=gemfiles/#{gemfile}.gemfile bundle exec rspec")
113
- raise 'Not successful'
112
+ raise "Not successful"
114
113
  end
115
114
  end
116
115
  end
@@ -118,60 +117,59 @@ end
118
117
  task :generate_bundle_and_spec_all do
119
118
  VERSION_MANAGERS.each do |version_manager, switch_command|
120
119
  out = []
121
- if version_manager == :rvm
122
- out << '#!/bin/bash --login'
123
- else
124
- out << '#!/bin/sh'
125
- end
126
- out << 'rm -f .ruby-version'
120
+ out << if version_manager == :rvm
121
+ "#!/bin/bash --login"
122
+ else
123
+ "#!/bin/sh"
124
+ end
125
+ out << "rm -f .ruby-version"
127
126
  out << "echo 'Using #{version_manager}'"
128
127
  RUBY_VERSIONS.each do |version|
129
- short_version = version.split('-').first
128
+ short_version = version.split("-").first
130
129
  out << "echo 'Switching to #{short_version}'"
131
130
  out << "#{switch_command.call(version)} || { echo 'Switching Ruby failed'; exit 1; }"
132
131
  out << "ruby -v"
133
132
  out << "echo 'Compiling extension'"
134
- out << 'cd ext && rm -f appsignal-agent appsignal_extension.bundle appsignal.h libappsignal.a Makefile && ruby extconf.rb && make && cd ..'
133
+ out << "cd ext && rm -f appsignal-agent appsignal_extension.bundle appsignal.h libappsignal.a Makefile && ruby extconf.rb && make && cd .."
135
134
  GEMFILES.each do |gemfile|
136
- unless EXCLUSIONS[gemfile] && EXCLUSIONS[gemfile].include?(short_version)
137
- out << "echo 'Bundling #{gemfile} in #{short_version}'"
138
- out << "bundle --quiet --gemfile gemfiles/#{gemfile}.gemfile || { echo 'Bundling failed'; exit 1; }"
139
- out << "echo 'Running #{gemfile} in #{short_version}'"
140
- out << "env BUNDLE_GEMFILE=gemfiles/#{gemfile}.gemfile bundle exec rspec || { echo 'Running specs failed'; exit 1; }"
141
- end
135
+ next if EXCLUSIONS[gemfile] && EXCLUSIONS[gemfile].include?(short_version)
136
+ out << "echo 'Bundling #{gemfile} in #{short_version}'"
137
+ out << "bundle --quiet --gemfile gemfiles/#{gemfile}.gemfile || { echo 'Bundling failed'; exit 1; }"
138
+ out << "echo 'Running #{gemfile} in #{short_version}'"
139
+ out << "env BUNDLE_GEMFILE=gemfiles/#{gemfile}.gemfile bundle exec rspec || { echo 'Running specs failed'; exit 1; }"
142
140
  end
143
141
  end
144
- out << 'rm -f .ruby-version'
142
+ out << "rm -f .ruby-version"
145
143
  out << "echo 'Successfully ran specs for all environments'"
146
144
 
147
145
  script = "bundle_and_spec_all_#{version_manager}"
148
146
  FileUtils.rm_f(script)
149
- File.open(script, 'w') do |file|
147
+ File.open(script, "w") do |file|
150
148
  file.write out.join("\n")
151
149
  end
152
- File.chmod(0775, script)
150
+ File.chmod(0o775, script)
153
151
  puts "Generated #{script}"
154
152
  end
155
153
  end
156
154
 
157
155
  task :console do
158
- require 'irb'
159
- require 'irb/completion'
160
- require 'appsignal'
156
+ require "irb"
157
+ require "irb/completion"
158
+ require "appsignal"
161
159
 
162
- Appsignal.config = Appsignal::Config.new('.', :console)
160
+ Appsignal.config = Appsignal::Config.new(".", :console)
163
161
 
164
162
  ARGV.clear
165
163
  IRB.start
166
164
  end
167
165
 
168
166
  namespace :extension do
169
- desc 'Install the AppSignal gem extension'
167
+ desc "Install the AppSignal gem extension"
170
168
  task :install => :clean do
171
- system 'cd ext && ruby extconf.rb && make clean && make'
169
+ system "cd ext && ruby extconf.rb && make clean && make"
172
170
  end
173
171
 
174
- desc 'Clean the AppSignal gem extension directory of installation artifacts'
172
+ desc "Clean the AppSignal gem extension directory of installation artifacts"
175
173
  task :clean do
176
174
  system <<-COMMAND
177
175
  cd ext &&
@@ -188,10 +186,10 @@ namespace :extension do
188
186
  end
189
187
 
190
188
  begin
191
- require 'rspec/core/rake_task'
192
- desc 'Run the AppSignal gem test suite.'
189
+ require "rspec/core/rake_task"
190
+ desc "Run the AppSignal gem test suite."
193
191
  RSpec::Core::RakeTask.new :test
194
- rescue LoadError
192
+ rescue LoadError # rubocop:disable Lint/HandleExceptions
195
193
  # When running rake install, there is no RSpec yet.
196
194
  end
197
195