rollbar 2.19.1 → 2.27.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +5 -5
  2. data/.github/pull_request_template.md +25 -0
  3. data/.rubocop.yml +168 -0
  4. data/.travis.yml +63 -34
  5. data/Appraisals +10 -10
  6. data/Gemfile +35 -14
  7. data/README.md +5 -2
  8. data/Rakefile +0 -0
  9. data/data/rollbar.snippet.js +1 -1
  10. data/docs/configuration.md +17 -0
  11. data/gemfiles/rails30.gemfile +10 -10
  12. data/gemfiles/rails31.gemfile +10 -9
  13. data/gemfiles/rails32.gemfile +10 -9
  14. data/gemfiles/rails40.gemfile +10 -9
  15. data/gemfiles/rails41.gemfile +10 -9
  16. data/gemfiles/rails42.gemfile +12 -9
  17. data/gemfiles/rails50.gemfile +21 -14
  18. data/gemfiles/rails51.gemfile +21 -14
  19. data/gemfiles/rails52.gemfile +15 -12
  20. data/gemfiles/rails60.gemfile +67 -0
  21. data/lib/generators/rollbar/rollbar_generator.rb +1 -1
  22. data/lib/rails/rollbar_runner.rb +4 -2
  23. data/lib/rollbar/capistrano.rb +1 -1
  24. data/lib/rollbar/capistrano3.rb +6 -3
  25. data/lib/rollbar/capistrano_tasks.rb +29 -21
  26. data/lib/rollbar/configuration.rb +86 -16
  27. data/lib/rollbar/delay/girl_friday.rb +4 -8
  28. data/lib/rollbar/delay/resque.rb +3 -6
  29. data/lib/rollbar/delay/sidekiq.rb +4 -10
  30. data/lib/rollbar/delay/sucker_punch.rb +16 -19
  31. data/lib/rollbar/delay/thread.rb +16 -2
  32. data/lib/rollbar/deploy.rb +52 -29
  33. data/lib/rollbar/encoding/encoder.rb +17 -10
  34. data/lib/rollbar/exception_reporter.rb +19 -5
  35. data/lib/rollbar/item/backtrace.rb +13 -3
  36. data/lib/rollbar/item/frame.rb +9 -1
  37. data/lib/rollbar/item/locals.rb +100 -0
  38. data/lib/rollbar/item.rb +56 -17
  39. data/lib/rollbar/json.rb +6 -51
  40. data/lib/rollbar/language_support.rb +4 -20
  41. data/lib/rollbar/lazy_store.rb +5 -5
  42. data/lib/rollbar/logger.rb +1 -0
  43. data/lib/rollbar/logger_proxy.rb +6 -2
  44. data/lib/rollbar/middleware/js.rb +28 -18
  45. data/lib/rollbar/middleware/rack.rb +4 -1
  46. data/lib/rollbar/middleware/rails/rollbar.rb +10 -1
  47. data/lib/rollbar/notifier/trace_with_bindings.rb +65 -0
  48. data/lib/rollbar/notifier.rb +225 -89
  49. data/lib/rollbar/plugin.rb +54 -6
  50. data/lib/rollbar/plugins/active_job.rb +6 -2
  51. data/lib/rollbar/plugins/basic_socket.rb +21 -6
  52. data/lib/rollbar/plugins/delayed_job/job_data.rb +3 -3
  53. data/lib/rollbar/plugins/delayed_job/plugin.rb +13 -3
  54. data/lib/rollbar/plugins/error_context.rb +11 -0
  55. data/lib/rollbar/plugins/goalie.rb +11 -3
  56. data/lib/rollbar/plugins/rails/controller_methods.rb +15 -3
  57. data/lib/rollbar/plugins/rake.rb +2 -2
  58. data/lib/rollbar/plugins/sidekiq/plugin.rb +5 -4
  59. data/lib/rollbar/plugins.rb +7 -1
  60. data/lib/rollbar/rake_tasks.rb +4 -148
  61. data/lib/rollbar/request_data_extractor.rb +31 -21
  62. data/lib/rollbar/rollbar_test.rb +36 -0
  63. data/lib/rollbar/scrubbers/params.rb +19 -18
  64. data/lib/rollbar/scrubbers/url.rb +18 -9
  65. data/lib/rollbar/scrubbers.rb +3 -3
  66. data/lib/rollbar/truncation/frames_strategy.rb +1 -1
  67. data/lib/rollbar/truncation/min_body_strategy.rb +2 -3
  68. data/lib/rollbar/truncation/mixin.rb +1 -1
  69. data/lib/rollbar/truncation/remove_any_key_strategy.rb +123 -0
  70. data/lib/rollbar/truncation/remove_extra_strategy.rb +35 -0
  71. data/lib/rollbar/truncation/remove_request_strategy.rb +21 -0
  72. data/lib/rollbar/truncation/strings_strategy.rb +6 -5
  73. data/lib/rollbar/truncation.rb +9 -2
  74. data/lib/rollbar/util/hash.rb +15 -0
  75. data/lib/rollbar/util/ip_anonymizer.rb +8 -7
  76. data/lib/rollbar/util/ip_obfuscator.rb +1 -1
  77. data/lib/rollbar/util.rb +6 -2
  78. data/lib/rollbar/version.rb +1 -1
  79. data/lib/rollbar.rb +2 -3
  80. data/lib/tasks/benchmark.rake +103 -0
  81. data/rollbar.gemspec +13 -5
  82. data/spec/support/rollbar_api.rb +67 -0
  83. metadata +21 -23
  84. data/gemfiles/ruby_1_8_and_1_9_2.gemfile +0 -49
  85. data/lib/rollbar/json/default.rb +0 -11
  86. data/lib/rollbar/json/oj.rb +0 -16
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
@@ -12,15 +19,7 @@ gem 'rails', '3.1.12'
12
19
  gem 'rspec-rails', '~> 3.4'
13
20
  gem 'rake'
14
21
 
15
- unless is_jruby
16
- if RUBY_VERSION >= '2.4.0'
17
- gem 'oj', '~> 2.16.1'
18
- else
19
- gem 'oj', '~> 2.12.14'
20
- end
21
- end
22
-
23
- if RUBY_VERSION > '1.8.7' && RUBY_VERSION < '2.2.2'
22
+ if RUBY_VERSION < '2.2.2'
24
23
  gem 'sidekiq', '~> 2.13.0'
25
24
  else
26
25
  gem 'sidekiq', '>= 2.13.0'
@@ -35,9 +34,11 @@ platforms :rbx do
35
34
  end
36
35
 
37
36
  if RUBY_VERSION.start_with?('1.9')
37
+ gem 'capistrano', '<= 3.4.1', :require => false
38
38
  gem 'sucker_punch'
39
39
  gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
40
40
  elsif RUBY_VERSION.start_with?('2')
41
+ gem 'capistrano', :require => false
41
42
  gem 'sucker_punch'
42
43
  gem 'shoryuken'
43
44
  gem 'codacy-coverage'
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'appraisal'
@@ -14,15 +21,7 @@ gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
14
21
  # Please see https://github.com/rspec/rspec-rails/issues/1273
15
22
  gem 'test-unit'
16
23
 
17
- unless is_jruby
18
- if RUBY_VERSION >= '2.4.0'
19
- gem 'oj', '~> 2.16.1'
20
- else
21
- gem 'oj', '~> 2.12.14'
22
- end
23
- end
24
-
25
- if RUBY_VERSION > '1.8.7' && RUBY_VERSION < '2.2.2'
24
+ if RUBY_VERSION < '2.2.2'
26
25
  gem 'sidekiq', '~> 2.13.0'
27
26
  else
28
27
  gem 'sidekiq', '>= 2.13.0'
@@ -37,9 +36,11 @@ platforms :rbx do
37
36
  end
38
37
 
39
38
  if RUBY_VERSION.start_with?('1.9')
39
+ gem 'capistrano', '<= 3.4.1', :require => false
40
40
  gem 'sucker_punch', '~> 1.0'
41
41
  gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
42
42
  elsif RUBY_VERSION.start_with?('2')
43
+ gem 'capistrano', :require => false
43
44
  gem 'sucker_punch', '~> 2.0'
44
45
  gem 'shoryuken'
45
46
  gem 'codacy-coverage'
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'appraisal'
@@ -14,15 +21,7 @@ gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
14
21
  # Please see https://github.com/rspec/rspec-rails/issues/1273
15
22
  gem 'test-unit'
16
23
 
17
- unless is_jruby
18
- if RUBY_VERSION >= '2.4.0'
19
- gem 'oj', '~> 2.16.1'
20
- else
21
- gem 'oj', '~> 2.12.14'
22
- end
23
- end
24
-
25
- if RUBY_VERSION > '1.8.7' && RUBY_VERSION < '2.2.2'
24
+ if RUBY_VERSION < '2.2.2'
26
25
  gem 'sidekiq', '~> 2.13.0'
27
26
  else
28
27
  gem 'sidekiq', '>= 2.13.0'
@@ -37,10 +36,12 @@ platforms :rbx do
37
36
  end
38
37
 
39
38
  if RUBY_VERSION.start_with?('1.9')
39
+ gem 'capistrano', '<= 3.4.1', :require => false
40
40
  gem 'sucker_punch', '~> 1.0'
41
41
  gem 'json', '~> 1.8'
42
42
  gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
43
43
  elsif RUBY_VERSION.start_with?('2')
44
+ gem 'capistrano', :require => false
44
45
  gem 'sucker_punch', '~> 2.0'
45
46
  gem 'json', '~> 2.0'
46
47
  gem 'shoryuken'
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'appraisal'
@@ -12,15 +19,7 @@ gem 'rake'
12
19
  gem 'rspec-rails', '~> 3.4'
13
20
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
14
21
 
15
- unless is_jruby
16
- if RUBY_VERSION >= '2.4.0'
17
- gem 'oj', '~> 2.16.1'
18
- else
19
- gem 'oj', '~> 2.12.14'
20
- end
21
- end
22
-
23
- if RUBY_VERSION > '1.8.7' && RUBY_VERSION < '2.2.2'
22
+ if RUBY_VERSION < '2.2.2'
24
23
  gem 'sidekiq', '~> 2.13.0'
25
24
  else
26
25
  gem 'sidekiq', '>= 2.13.0'
@@ -34,9 +33,11 @@ platforms :rbx do
34
33
  end
35
34
 
36
35
  if RUBY_VERSION.start_with?('1.9')
36
+ gem 'capistrano', '<= 3.4.1', :require => false
37
37
  gem 'sucker_punch', '~> 1.0'
38
38
  gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
39
39
  elsif RUBY_VERSION.start_with?('2')
40
+ gem 'capistrano', :require => false
40
41
  gem 'sucker_punch', '~> 2.0'
41
42
  gem 'shoryuken'
42
43
  gem 'codacy-coverage'
@@ -2,6 +2,13 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
  is_not_jruby = !is_jruby
7
14
 
@@ -20,25 +27,21 @@ platforms :rbx do
20
27
  gem 'rubysl', '~> 2.0' unless RUBY_VERSION.start_with?('1')
21
28
  end
22
29
 
23
- unless is_jruby
24
- if RUBY_VERSION >= '2.5'
25
- gem 'oj'
26
- elsif RUBY_VERSION >= '2.4.0'
27
- gem 'oj', '~> 2.16.1'
28
- else
29
- gem 'oj', '~> 2.12.14'
30
- end
30
+ if RUBY_VERSION < '2.0.0'
31
+ gem 'json', '1.8.6'
31
32
  end
32
33
 
33
- if RUBY_VERSION > '1.8.7' && RUBY_VERSION < '2.2.2'
34
+ if RUBY_VERSION < '2.2.2'
34
35
  gem 'sidekiq', '~> 2.13.0'
35
36
  else
36
37
  gem 'sidekiq', '>= 2.13.0'
37
38
  end
38
39
 
39
40
  if RUBY_VERSION.start_with?('1.9')
41
+ gem 'capistrano', '<= 3.4.1', :require => false
40
42
  gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
41
43
  elsif RUBY_VERSION.start_with?('2')
44
+ gem 'capistrano', :require => false
42
45
  gem 'shoryuken'
43
46
  end
44
47
 
@@ -2,12 +2,19 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'appraisal'
8
15
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
9
16
  gem 'jruby-openssl', :platform => :jruby
10
- gem 'rails', '~> 5.0.0'
17
+ gem 'rails', '~> 5.0.7'
11
18
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
12
19
 
13
20
  gem 'rspec-core', '~> 3.5.0.beta3'
@@ -20,16 +27,6 @@ gem 'rake'
20
27
 
21
28
  gem 'sidekiq', '>= 2.13.0'
22
29
 
23
- unless is_jruby
24
- if RUBY_VERSION >= '2.5'
25
- gem 'oj'
26
- elsif RUBY_VERSION >= '2.4.0'
27
- gem 'oj', '~> 2.16.1'
28
- else
29
- gem 'oj', '~> 2.12.14'
30
- end
31
- end
32
-
33
30
  platforms :rbx do
34
31
  gem 'minitest'
35
32
  gem 'racc'
@@ -38,23 +35,33 @@ platforms :rbx do
38
35
  end
39
36
 
40
37
  if RUBY_VERSION.start_with?('1.9')
38
+ gem 'capistrano', '<= 3.4.1', :require => false
41
39
  gem 'sucker_punch', '~> 1.0'
42
40
  elsif RUBY_VERSION.start_with?('2')
41
+ gem 'capistrano', :require => false
43
42
  gem 'sucker_punch', '~> 2.0'
44
43
  gem 'codacy-coverage'
45
44
  gem 'simplecov'
46
45
  end
47
46
 
48
- # We need last sinatra that uses rack 2.x
49
- gem 'sinatra', :git => 'https://github.com/sinatra/sinatra'
47
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
48
+ gem 'rack', '2.1.2'
49
+ end
50
+
51
+ # We need last sinatra that uses rack 2.1.x
52
+ gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag => 'v2.0.8'
50
53
  gem 'database_cleaner'
51
54
  gem 'delayed_job', :require => false
52
55
  gem 'generator_spec'
53
56
  gem 'girl_friday', '>= 0.11.1'
54
- gem 'rspec-command'
55
57
  gem 'redis'
56
58
  gem 'resque'
57
59
 
60
+ unless is_jruby
61
+ # JRuby doesn't support fork, which is required for this test helper.
62
+ gem 'rspec-command'
63
+ end
64
+
58
65
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
59
66
  gem 'mime-types', '< 3.0'
60
67
  end
@@ -2,12 +2,19 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'appraisal'
8
15
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
9
16
  gem 'jruby-openssl', :platform => :jruby
10
- gem 'rails', '~> 5.1.0'
17
+ gem 'rails', '~> 5.1.7'
11
18
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
12
19
 
13
20
  gem 'rspec-core', '~> 3.5.0.beta3'
@@ -20,16 +27,6 @@ gem 'rake'
20
27
 
21
28
  gem 'sidekiq', '>= 2.13.0'
22
29
 
23
- unless is_jruby
24
- if RUBY_VERSION >= '2.5'
25
- gem 'oj'
26
- elsif RUBY_VERSION >= '2.4.0'
27
- gem 'oj', '~> 2.16.1'
28
- else
29
- gem 'oj', '~> 2.12.14'
30
- end
31
- end
32
-
33
30
  platforms :rbx do
34
31
  gem 'minitest'
35
32
  gem 'racc'
@@ -38,24 +35,34 @@ platforms :rbx do
38
35
  end
39
36
 
40
37
  if RUBY_VERSION.start_with?('1.9')
38
+ gem 'capistrano', '<= 3.4.1', :require => false
41
39
  gem 'sucker_punch', '~> 1.0'
42
40
  elsif RUBY_VERSION.start_with?('2')
41
+ gem 'capistrano', :require => false
43
42
  gem 'sucker_punch', '~> 2.0'
44
43
  gem 'codacy-coverage'
45
44
  gem 'simplecov'
46
45
  end
47
46
 
48
- # We need last sinatra that uses rack 2.x
49
- gem 'sinatra', :git => 'https://github.com/sinatra/sinatra'
47
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
48
+ gem 'rack', '2.1.2'
49
+ end
50
+
51
+ # We need last sinatra that uses rack 2.1.x
52
+ gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag => 'v2.0.8'
50
53
 
51
54
  gem 'database_cleaner'
52
55
  gem 'delayed_job', :require => false
53
56
  gem 'generator_spec'
54
57
  gem 'girl_friday', '>= 0.11.1'
55
- gem 'rspec-command'
56
58
  gem 'redis'
57
59
  gem 'resque'
58
60
 
61
+ unless is_jruby
62
+ # JRuby doesn't support fork, which is required for this test helper.
63
+ gem 'rspec-command'
64
+ end
65
+
59
66
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
60
67
  gem 'mime-types', '< 3.0'
61
68
  end
@@ -2,12 +2,19 @@ require 'rubygems/version'
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
6
+ # new process is created during tests. (Testing rake tasks, for example.)
7
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
8
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
9
+ # with the wrong gemfile path.
10
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
+
5
12
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
6
13
 
7
14
  gem 'appraisal'
8
15
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
9
16
  gem 'jruby-openssl', :platform => :jruby
10
- gem 'rails', '~> 5.2.0'
17
+ gem 'rails', '~> 5.2.3'
11
18
  gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
12
19
 
13
20
  gem 'rspec-core', '~> 3.8.0'
@@ -18,16 +25,6 @@ gem 'rspec-mocks', '~> 3.8.0'
18
25
 
19
26
  gem 'rake'
20
27
 
21
- unless is_jruby
22
- if RUBY_VERSION >= '2.5'
23
- gem 'oj'
24
- elsif RUBY_VERSION >= '2.4.0'
25
- gem 'oj', '~> 2.16.1'
26
- else
27
- gem 'oj', '~> 2.12.14'
28
- end
29
- end
30
-
31
28
  gem 'sidekiq', '>= 2.13.0'
32
29
 
33
30
  platforms :rbx do
@@ -47,11 +44,15 @@ gem 'codacy-coverage'
47
44
  gem 'delayed_job', :require => false
48
45
  gem 'generator_spec'
49
46
  gem 'girl_friday', '>= 0.11.1'
50
- gem 'rspec-command'
51
47
  gem 'redis'
52
48
  gem 'resque'
53
49
  gem 'simplecov'
54
50
 
51
+ unless is_jruby
52
+ # JRuby doesn't support fork, which is required for this test helper.
53
+ gem 'rspec-command'
54
+ end
55
+
55
56
  gem 'mime-types'
56
57
 
57
58
  gem 'webmock', :require => false
@@ -59,4 +60,6 @@ gem 'webmock', :require => false
59
60
  gem 'aws-sdk-sqs'
60
61
  gem 'shoryuken'
61
62
 
63
+ gem 'capistrano', :require => false
64
+
62
65
  gemspec :path => '../'
@@ -0,0 +1,67 @@
1
+
2
+ require 'rubygems/version'
3
+
4
+ source 'https://rubygems.org'
5
+
6
+ # Used by spec/commands/rollbar_rails_runner_spec, and can be used whenever a
7
+ # new process is created during tests. (Testing rake tasks, for example.)
8
+ # This is a workaround for ENV['BUNDLE_GEMFILE'] not working as expected on Travis.
9
+ # We use the ||= assignment because Travis loads the gemfile twice, the second time
10
+ # with the wrong gemfile path.
11
+ ENV['CURRENT_GEMFILE'] ||= __FILE__
12
+
13
+ is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
14
+
15
+ gem 'appraisal'
16
+ gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
17
+ gem 'jruby-openssl', :platform => :jruby
18
+ gem 'rails', '6.0.2.1'
19
+ gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw]
20
+
21
+ gem 'rspec-core', '~> 3.8.0'
22
+ gem 'rspec-support', '~> 3.8.0'
23
+ gem 'rspec-expectations', '~> 3.8.0'
24
+ gem 'rspec-mocks', '~> 3.8.0'
25
+ # TODO: update this when 4.x becomes available on Rubygems
26
+ gem 'rspec-rails', :git => 'https://github.com/rspec/rspec-rails', :ref => 'v4.0.0.beta2' # rubocop:disable Bundler/DuplicatedGem
27
+
28
+ gem 'rake'
29
+
30
+ gem 'sidekiq', '>= 2.13.0'
31
+
32
+ platforms :rbx do
33
+ gem 'minitest'
34
+ gem 'racc'
35
+ gem 'rubinius-developer_tools'
36
+ gem 'rubysl', '~> 2.0' unless RUBY_VERSION.start_with?('1')
37
+ end
38
+
39
+ gem 'sucker_punch', '~> 2.0'
40
+
41
+ # We need last sinatra that uses rack 2.x
42
+ gem 'sinatra', :git => 'https://github.com/sinatra/sinatra'
43
+
44
+ gem 'database_cleaner'
45
+ gem 'codacy-coverage'
46
+ gem 'delayed_job', '4.1.8.beta1', :require => false
47
+ gem 'generator_spec'
48
+ gem 'girl_friday', '>= 0.11.1'
49
+ gem 'redis'
50
+ gem 'resque'
51
+ gem 'simplecov'
52
+
53
+ unless is_jruby
54
+ # JRuby doesn't support fork, which is required for this test helper.
55
+ gem 'rspec-command'
56
+ end
57
+
58
+ gem 'mime-types'
59
+
60
+ gem 'webmock', :require => false
61
+
62
+ gem 'aws-sdk-sqs'
63
+ gem 'shoryuken'
64
+
65
+ gem 'capistrano', :require => false
66
+
67
+ gemspec :path => '../'
@@ -52,7 +52,7 @@ module Rollbar
52
52
  end
53
53
 
54
54
  def access_token_configured?
55
- File.exists?('config/initializers/rollbar.rb')
55
+ File.exist?('config/initializers/rollbar.rb')
56
56
  end
57
57
  end
58
58
  end
@@ -39,7 +39,7 @@ module Rails
39
39
  end
40
40
 
41
41
  def eval_runner
42
- if Rails.version >= '5.0.0'
42
+ if Gem::Version.new(Rails.version) >= Gem::Version.new('5.1.0')
43
43
  rails5_runner
44
44
  else
45
45
  legacy_runner
@@ -55,12 +55,14 @@ module Rails
55
55
  end
56
56
 
57
57
  def rails5_runner
58
+ require 'rails/command'
59
+
58
60
  Rails::Command.invoke 'runner', ARGV
59
61
  end
60
62
 
61
63
  def rollbar_managed
62
64
  yield
63
- rescue => e
65
+ rescue StandardError => e
64
66
  Rollbar.scope(:custom => { :command => command }).error(e)
65
67
  raise
66
68
  end
@@ -35,7 +35,7 @@ module Rollbar
35
35
  _cset(:rollbar_user) { ENV['USER'] || ENV['USERNAME'] }
36
36
  _cset(:rollbar_env) { fetch(:rails_env, 'production') }
37
37
  _cset(:rollbar_token) { abort("Please specify the Rollbar access token, set :rollbar_token, 'your token'") }
38
- _cset(:rollbar_revision) { current_revision }
38
+ _cset(:rollbar_revision) { real_revision }
39
39
  _cset(:rollbar_comment) { nil }
40
40
  end
41
41
  end
@@ -7,24 +7,27 @@ require 'rollbar/deploy'
7
7
  require 'rollbar/capistrano_tasks'
8
8
 
9
9
  namespace :rollbar do
10
+ # dry_run? wasn't introduced till Capistrano 3.5.0; use the old fetch(:sshkit_backed)
11
+ set :dry_run, (proc { ::Capistrano::Configuration.env.fetch(:sshkit_backend) == ::SSHKit::Backend::Printer })
12
+
10
13
  desc 'Send deployment started notification to Rollbar.'
11
14
  task :deploy_started do
12
15
  on primary fetch(:rollbar_role) do
13
- ::Rollbar::CapistranoTasks.deploy_started(self, self, dry_run?)
16
+ ::Rollbar::CapistranoTasks.deploy_started(self, self, fetch(:dry_run))
14
17
  end
15
18
  end
16
19
 
17
20
  desc 'Send deployment succeeded notification to Rollbar.'
18
21
  task :deploy_succeeded do
19
22
  on primary fetch(:rollbar_role) do
20
- ::Rollbar::CapistranoTasks.deploy_succeeded(self, self, dry_run?)
23
+ ::Rollbar::CapistranoTasks.deploy_succeeded(self, self, fetch(:dry_run))
21
24
  end
22
25
  end
23
26
 
24
27
  desc 'Send deployment failed notification to Rollbar.'
25
28
  task :deploy_failed do
26
29
  on primary fetch(:rollbar_role) do
27
- ::Rollbar::CapistranoTasks.deploy_failed(self, self, dry_run?)
30
+ ::Rollbar::CapistranoTasks.deploy_failed(self, self, fetch(:dry_run))
28
31
  end
29
32
  end
30
33