rollbar 2.16.2 → 2.22.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +47 -0
- data/.travis.yml +182 -94
- data/Appraisals +10 -10
- data/Gemfile +45 -13
- data/README.md +20 -3
- data/Rakefile +0 -0
- data/data/rollbar.snippet.js +1 -1
- data/docs/configuration.md +15 -0
- data/gemfiles/rails30.gemfile +21 -14
- data/gemfiles/rails31.gemfile +21 -12
- data/gemfiles/rails32.gemfile +18 -8
- data/gemfiles/rails40.gemfile +18 -6
- data/gemfiles/rails41.gemfile +17 -6
- data/gemfiles/rails42.gemfile +24 -14
- data/gemfiles/rails50.gemfile +20 -11
- data/gemfiles/rails51.gemfile +20 -10
- data/gemfiles/rails52.gemfile +65 -0
- data/gemfiles/rails60.gemfile +67 -0
- data/lib/generators/rollbar/rollbar_generator.rb +1 -1
- data/lib/rails/rollbar_runner.rb +17 -2
- data/lib/rollbar.rb +2 -3
- data/lib/rollbar/capistrano.rb +71 -39
- data/lib/rollbar/capistrano3.rb +56 -1
- data/lib/rollbar/capistrano_tasks.rb +130 -0
- data/lib/rollbar/configuration.rb +95 -7
- data/lib/rollbar/delay/active_job.rb +17 -0
- data/lib/rollbar/delay/girl_friday.rb +2 -2
- data/lib/rollbar/delay/resque.rb +4 -6
- data/lib/rollbar/delay/shoryuken.rb +15 -9
- data/lib/rollbar/delay/sidekiq.rb +6 -8
- data/lib/rollbar/delay/sucker_punch.rb +17 -19
- data/lib/rollbar/delay/thread.rb +3 -3
- data/lib/rollbar/deploy.rb +90 -0
- data/lib/rollbar/encoding/encoder.rb +9 -9
- data/lib/rollbar/exception_reporter.rb +19 -5
- data/lib/rollbar/item.rb +62 -20
- data/lib/rollbar/item/backtrace.rb +4 -4
- data/lib/rollbar/item/frame.rb +7 -1
- data/lib/rollbar/item/locals.rb +56 -0
- data/lib/rollbar/json.rb +5 -51
- data/lib/rollbar/language_support.rb +4 -20
- data/lib/rollbar/lazy_store.rb +5 -5
- data/lib/rollbar/logger.rb +1 -0
- data/lib/rollbar/logger_proxy.rb +15 -2
- data/lib/rollbar/middleware/js.rb +110 -10
- data/lib/rollbar/middleware/js/json_value.rb +26 -0
- data/lib/rollbar/middleware/rack.rb +4 -1
- data/lib/rollbar/middleware/rails/rollbar.rb +10 -1
- data/lib/rollbar/notifier.rb +118 -49
- data/lib/rollbar/notifier/trace_with_bindings.rb +65 -0
- data/lib/rollbar/plugin.rb +54 -6
- data/lib/rollbar/plugins.rb +7 -1
- data/lib/rollbar/plugins/active_job.rb +5 -1
- data/lib/rollbar/plugins/basic_socket.rb +21 -6
- data/lib/rollbar/plugins/delayed_job/job_data.rb +3 -3
- data/lib/rollbar/plugins/delayed_job/plugin.rb +3 -3
- data/lib/rollbar/plugins/goalie.rb +11 -3
- data/lib/rollbar/plugins/rails/controller_methods.rb +17 -4
- data/lib/rollbar/plugins/rails/railtie_mixin.rb +7 -3
- data/lib/rollbar/plugins/rake.rb +2 -2
- data/lib/rollbar/plugins/sidekiq/plugin.rb +10 -6
- data/lib/rollbar/rake_tasks.rb +3 -86
- data/lib/rollbar/request_data_extractor.rb +35 -21
- data/lib/rollbar/rollbar_test.rb +147 -0
- data/lib/rollbar/scrubbers.rb +7 -3
- data/lib/rollbar/scrubbers/params.rb +38 -20
- data/lib/rollbar/scrubbers/url.rb +27 -13
- data/lib/rollbar/truncation.rb +9 -2
- data/lib/rollbar/truncation/min_body_strategy.rb +2 -3
- data/lib/rollbar/truncation/remove_any_key_strategy.rb +123 -0
- data/lib/rollbar/truncation/remove_extra_strategy.rb +35 -0
- data/lib/rollbar/truncation/remove_request_strategy.rb +21 -0
- data/lib/rollbar/truncation/strings_strategy.rb +3 -4
- data/lib/rollbar/util.rb +75 -45
- data/lib/rollbar/util/hash.rb +30 -6
- data/lib/rollbar/util/ip_anonymizer.rb +8 -7
- data/lib/rollbar/util/ip_obfuscator.rb +1 -1
- data/lib/rollbar/version.rb +1 -1
- data/lib/tasks/benchmark.rake +103 -0
- data/rollbar.gemspec +14 -8
- metadata +25 -277
- data/gemfiles/ruby_1_8_and_1_9_2.gemfile +0 -49
- data/lib/rollbar/json/default.rb +0 -11
- data/lib/rollbar/json/oj.rb +0 -16
- data/lib/rollbar/tasks/rollbar.cap +0 -47
- data/spec/cacert.pem +0 -3988
- data/spec/controllers/home_controller_spec.rb +0 -480
- data/spec/delay/sidekiq_spec.rb +0 -61
- data/spec/delay/sucker_punch_spec.rb +0 -25
- data/spec/delayed/backend/test.rb +0 -140
- data/spec/delayed/serialization/test.rb +0 -0
- data/spec/dummyapp/.gitignore +0 -73
- data/spec/dummyapp/Rakefile +0 -7
- data/spec/dummyapp/app/assets/javascripts/application.js +0 -3
- data/spec/dummyapp/app/assets/stylesheets/application.css.scss +0 -37
- data/spec/dummyapp/app/controllers/application_controller.rb +0 -3
- data/spec/dummyapp/app/controllers/home_controller.rb +0 -60
- data/spec/dummyapp/app/controllers/users_controller.rb +0 -17
- data/spec/dummyapp/app/helpers/.gitkeep +0 -0
- data/spec/dummyapp/app/mailers/.gitkeep +0 -0
- data/spec/dummyapp/app/models/.gitkeep +0 -0
- data/spec/dummyapp/app/models/book.rb +0 -5
- data/spec/dummyapp/app/models/post.rb +0 -9
- data/spec/dummyapp/app/models/user.rb +0 -9
- data/spec/dummyapp/app/views/devise/registrations/edit.html.erb +0 -27
- data/spec/dummyapp/app/views/devise/registrations/new.html.erb +0 -20
- data/spec/dummyapp/app/views/devise/shared/_links.html.erb +0 -25
- data/spec/dummyapp/app/views/home/cause_exception.html.erb +0 -1
- data/spec/dummyapp/app/views/home/index.html.erb +0 -4
- data/spec/dummyapp/app/views/home/report_exception.html.erb +0 -1
- data/spec/dummyapp/app/views/js/test.html.erb +0 -1
- data/spec/dummyapp/app/views/layouts/_messages.html.erb +0 -5
- data/spec/dummyapp/app/views/layouts/_navigation.html.erb +0 -21
- data/spec/dummyapp/app/views/layouts/application.html.erb +0 -25
- data/spec/dummyapp/app/views/layouts/simple.html.erb +0 -18
- data/spec/dummyapp/app/views/users/index.html.erb +0 -8
- data/spec/dummyapp/app/views/users/show.html.erb +0 -3
- data/spec/dummyapp/config.ru +0 -4
- data/spec/dummyapp/config/application.rb +0 -59
- data/spec/dummyapp/config/boot.rb +0 -10
- data/spec/dummyapp/config/database.yml +0 -25
- data/spec/dummyapp/config/environment.rb +0 -5
- data/spec/dummyapp/config/environments/development.rb +0 -37
- data/spec/dummyapp/config/environments/production.rb +0 -67
- data/spec/dummyapp/config/environments/test.rb +0 -37
- data/spec/dummyapp/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummyapp/config/initializers/inflections.rb +0 -15
- data/spec/dummyapp/config/initializers/mime_types.rb +0 -5
- data/spec/dummyapp/config/initializers/rollbar.rb +0 -26
- data/spec/dummyapp/config/initializers/secret_token.rb +0 -7
- data/spec/dummyapp/config/initializers/session_store.rb +0 -8
- data/spec/dummyapp/config/initializers/wrap_parameters.rb +0 -16
- data/spec/dummyapp/config/locales/devise.en.yml +0 -58
- data/spec/dummyapp/config/locales/en.yml +0 -5
- data/spec/dummyapp/config/routes.rb +0 -17
- data/spec/dummyapp/config/secrets.yml +0 -2
- data/spec/dummyapp/db/migrate/20121121184652_devise_create_users.rb +0 -46
- data/spec/dummyapp/db/migrate/20121121184654_add_name_to_users.rb +0 -5
- data/spec/dummyapp/db/migrate/20161219184410_create_books.rb +0 -10
- data/spec/dummyapp/db/migrate/20161219185529_add_username_to_users.rb +0 -5
- data/spec/dummyapp/db/schema.rb +0 -41
- data/spec/dummyapp/db/seeds.rb +0 -12
- data/spec/dummyapp/lib/assets/.gitkeep +0 -0
- data/spec/dummyapp/public/404.html +0 -26
- data/spec/dummyapp/public/422.html +0 -26
- data/spec/dummyapp/public/500.html +0 -25
- data/spec/dummyapp/public/favicon.ico +0 -0
- data/spec/dummyapp/script/rails +0 -6
- data/spec/fixtures/file1 +0 -1
- data/spec/fixtures/file2 +0 -1
- data/spec/fixtures/payloads/message.json +0 -25
- data/spec/fixtures/payloads/sample.trace.json +0 -275
- data/spec/fixtures/payloads/sample.trace_chain.json +0 -530
- data/spec/fixtures/plugins/dummy1.rb +0 -5
- data/spec/fixtures/plugins/dummy2.rb +0 -5
- data/spec/generators/rollbar/rollbar_generator_rails30_spec.rb +0 -31
- data/spec/generators/rollbar/rollbar_generator_spec.rb +0 -51
- data/spec/requests/home_spec.rb +0 -49
- data/spec/rollbar/configuration_spec.rb +0 -46
- data/spec/rollbar/delay/delayed_job_spec.rb +0 -22
- data/spec/rollbar/delay/girl_friday_spec.rb +0 -41
- data/spec/rollbar/delay/resque_spec.rb +0 -37
- data/spec/rollbar/delay/thread_spec.rb +0 -27
- data/spec/rollbar/encoding/encoder_spec.rb +0 -63
- data/spec/rollbar/item/backtrace_spec.rb +0 -26
- data/spec/rollbar/item/frame_spec.rb +0 -267
- data/spec/rollbar/item_spec.rb +0 -736
- data/spec/rollbar/json/oj_spec.rb +0 -18
- data/spec/rollbar/json_spec.rb +0 -110
- data/spec/rollbar/lazy_store_spec.rb +0 -99
- data/spec/rollbar/logger_proxy_spec.rb +0 -50
- data/spec/rollbar/logger_spec.rb +0 -124
- data/spec/rollbar/middleware/js_spec.rb +0 -421
- data/spec/rollbar/middleware/sinatra_spec.rb +0 -197
- data/spec/rollbar/notifier_spec.rb +0 -56
- data/spec/rollbar/plugin_spec.rb +0 -209
- data/spec/rollbar/plugins/active_job_spec.rb +0 -38
- data/spec/rollbar/plugins/delayed_job/job_data_spec.rb +0 -48
- data/spec/rollbar/plugins/delayed_job_spec.rb +0 -129
- data/spec/rollbar/plugins/rack_spec.rb +0 -152
- data/spec/rollbar/plugins/rails_js_spec.rb +0 -19
- data/spec/rollbar/plugins/rake_spec.rb +0 -34
- data/spec/rollbar/plugins/resque/failure_spec.rb +0 -36
- data/spec/rollbar/plugins/sidekiq_spec.rb +0 -171
- data/spec/rollbar/plugins/validations_spec.rb +0 -56
- data/spec/rollbar/plugins_spec.rb +0 -68
- data/spec/rollbar/request_data_extractor_spec.rb +0 -270
- data/spec/rollbar/scrubbers/params_spec.rb +0 -314
- data/spec/rollbar/scrubbers/url_spec.rb +0 -136
- data/spec/rollbar/scrubbers_spec.rb +0 -31
- data/spec/rollbar/sidekig/clear_scope_spec.rb +0 -19
- data/spec/rollbar/truncation/frames_strategy_spec.rb +0 -70
- data/spec/rollbar/truncation/min_body_strategy_spec.rb +0 -57
- data/spec/rollbar/truncation/strings_strategy_spec.rb +0 -89
- data/spec/rollbar/truncation_spec.rb +0 -27
- data/spec/rollbar/util/hash_spec.rb +0 -22
- data/spec/rollbar/util/ip_anonymizer_spec.rb +0 -30
- data/spec/rollbar/util_spec.rb +0 -80
- data/spec/rollbar_bc_spec.rb +0 -380
- data/spec/rollbar_spec.rb +0 -1667
- data/spec/spec_helper.rb +0 -84
- data/spec/support/cause_exception.rb +0 -1
- data/spec/support/encoding_helpers.rb +0 -8
- data/spec/support/encodings/iso_8859_9 +0 -1
- data/spec/support/fixture_helpers.rb +0 -10
- data/spec/support/get_ip_raising.rb +0 -7
- data/spec/support/helpers.rb +0 -5
- data/spec/support/matchers.rb +0 -23
- data/spec/support/notifier_helpers.rb +0 -57
- data/spec/support/rollbar_api.rb +0 -57
- data/spec/support/shared_contexts.rb +0 -12
data/gemfiles/rails42.gemfile
CHANGED
@@ -2,22 +2,23 @@ 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
|
|
8
15
|
gem 'appraisal'
|
9
16
|
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
|
10
17
|
gem 'jruby-openssl', :platform => :jruby
|
11
|
-
gem 'rails', '4.2.
|
18
|
+
gem 'rails', '4.2.8'
|
12
19
|
gem 'rake'
|
13
20
|
gem 'rspec-rails', '~> 3.4'
|
14
|
-
gem 'sqlite3', :platform => [:ruby, :mswin, :mingw]
|
15
|
-
|
16
|
-
if RUBY_VERSION > '1.8.7' && RUBY_VERSION < '2.2.2'
|
17
|
-
gem 'sidekiq', '>= 2.13.0', '< 5.0'
|
18
|
-
else
|
19
|
-
gem 'sidekiq', '>= 2.13.0'
|
20
|
-
end
|
21
|
+
gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
|
21
22
|
|
22
23
|
platforms :rbx do
|
23
24
|
gem 'minitest'
|
@@ -26,17 +27,25 @@ platforms :rbx do
|
|
26
27
|
gem 'rubysl', '~> 2.0' unless RUBY_VERSION.start_with?('1')
|
27
28
|
end
|
28
29
|
|
29
|
-
if RUBY_VERSION
|
30
|
-
gem '
|
31
|
-
|
32
|
-
gem '
|
30
|
+
if RUBY_VERSION < '2.2.2'
|
31
|
+
gem 'sidekiq', '~> 2.13.0'
|
32
|
+
else
|
33
|
+
gem 'sidekiq', '>= 2.13.0'
|
34
|
+
end
|
35
|
+
|
36
|
+
if RUBY_VERSION.start_with?('1.9')
|
37
|
+
gem 'capistrano', '<= 3.4.1', :require => false
|
38
|
+
gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
|
39
|
+
elsif RUBY_VERSION.start_with?('2')
|
40
|
+
gem 'capistrano', :require => false
|
41
|
+
gem 'shoryuken'
|
33
42
|
end
|
34
43
|
|
35
|
-
gem 'codeclimate-test-reporter', :group => :test, :require => nil
|
36
44
|
gem 'database_cleaner', '~> 1.0.0'
|
37
45
|
gem 'delayed_job', :require => false
|
38
46
|
gem 'generator_spec'
|
39
47
|
gem 'girl_friday', '>= 0.11.1'
|
48
|
+
gem 'rspec-command'
|
40
49
|
gem 'redis'
|
41
50
|
gem 'resque'
|
42
51
|
gem 'sinatra'
|
@@ -51,9 +60,10 @@ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
|
|
51
60
|
else
|
52
61
|
gem 'sucker_punch', '~> 2.0'
|
53
62
|
gem 'webmock', :require => false
|
63
|
+
gem 'codacy-coverage'
|
64
|
+
gem 'simplecov'
|
54
65
|
end
|
55
66
|
|
56
67
|
gem 'aws-sdk-sqs'
|
57
|
-
gem 'shoryuken'
|
58
68
|
|
59
69
|
gemspec :path => '../'
|
data/gemfiles/rails50.gemfile
CHANGED
@@ -2,13 +2,20 @@ 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.
|
11
|
-
gem 'sqlite3', :platform => [:ruby, :mswin, :mingw]
|
17
|
+
gem 'rails', '~> 5.0.7'
|
18
|
+
gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
|
12
19
|
|
13
20
|
gem 'rspec-core', '~> 3.5.0.beta3'
|
14
21
|
gem 'rspec-rails', '~> 3.5.0.beta3'
|
@@ -18,12 +25,7 @@ gem 'rspec-mocks', '~> 3.5.0.beta3'
|
|
18
25
|
|
19
26
|
gem 'rake'
|
20
27
|
|
21
|
-
gem '
|
22
|
-
if RUBY_VERSION > '1.8.7' && RUBY_VERSION < '2.2.2'
|
23
|
-
gem 'sidekiq', '>= 2.13.0', '< 5.0'
|
24
|
-
else
|
25
|
-
gem 'sidekiq', '>= 2.13.0'
|
26
|
-
end
|
28
|
+
gem 'sidekiq', '>= 2.13.0'
|
27
29
|
|
28
30
|
platforms :rbx do
|
29
31
|
gem 'minitest'
|
@@ -33,22 +35,29 @@ platforms :rbx do
|
|
33
35
|
end
|
34
36
|
|
35
37
|
if RUBY_VERSION.start_with?('1.9')
|
38
|
+
gem 'capistrano', '<= 3.4.1', :require => false
|
36
39
|
gem 'sucker_punch', '~> 1.0'
|
37
40
|
elsif RUBY_VERSION.start_with?('2')
|
41
|
+
gem 'capistrano', :require => false
|
38
42
|
gem 'sucker_punch', '~> 2.0'
|
43
|
+
gem 'codacy-coverage'
|
44
|
+
gem 'simplecov'
|
39
45
|
end
|
40
46
|
|
41
47
|
# We need last sinatra that uses rack 2.x
|
42
48
|
gem 'sinatra', :git => 'https://github.com/sinatra/sinatra'
|
43
|
-
|
44
|
-
gem 'codeclimate-test-reporter', :group => :test, :require => nil
|
45
|
-
gem 'database_cleaner', '~> 1.x'
|
49
|
+
gem 'database_cleaner'
|
46
50
|
gem 'delayed_job', :require => false
|
47
51
|
gem 'generator_spec'
|
48
52
|
gem 'girl_friday', '>= 0.11.1'
|
49
53
|
gem 'redis'
|
50
54
|
gem 'resque'
|
51
55
|
|
56
|
+
unless is_jruby
|
57
|
+
# JRuby doesn't support fork, which is required for this test helper.
|
58
|
+
gem 'rspec-command'
|
59
|
+
end
|
60
|
+
|
52
61
|
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
|
53
62
|
gem 'mime-types', '< 3.0'
|
54
63
|
end
|
data/gemfiles/rails51.gemfile
CHANGED
@@ -2,13 +2,20 @@ 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.
|
11
|
-
gem 'sqlite3', :platform => [:ruby, :mswin, :mingw]
|
17
|
+
gem 'rails', '~> 5.1.7'
|
18
|
+
gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
|
12
19
|
|
13
20
|
gem 'rspec-core', '~> 3.5.0.beta3'
|
14
21
|
gem 'rspec-rails', '~> 3.5.0.beta3'
|
@@ -18,12 +25,7 @@ gem 'rspec-mocks', '~> 3.5.0.beta3'
|
|
18
25
|
|
19
26
|
gem 'rake'
|
20
27
|
|
21
|
-
gem '
|
22
|
-
if RUBY_VERSION > '1.8.7' && RUBY_VERSION < '2.2.2'
|
23
|
-
gem 'sidekiq', '>= 2.13.0', '< 5.0'
|
24
|
-
else
|
25
|
-
gem 'sidekiq', '>= 2.13.0'
|
26
|
-
end
|
28
|
+
gem 'sidekiq', '>= 2.13.0'
|
27
29
|
|
28
30
|
platforms :rbx do
|
29
31
|
gem 'minitest'
|
@@ -33,22 +35,30 @@ platforms :rbx do
|
|
33
35
|
end
|
34
36
|
|
35
37
|
if RUBY_VERSION.start_with?('1.9')
|
38
|
+
gem 'capistrano', '<= 3.4.1', :require => false
|
36
39
|
gem 'sucker_punch', '~> 1.0'
|
37
40
|
elsif RUBY_VERSION.start_with?('2')
|
41
|
+
gem 'capistrano', :require => false
|
38
42
|
gem 'sucker_punch', '~> 2.0'
|
43
|
+
gem 'codacy-coverage'
|
44
|
+
gem 'simplecov'
|
39
45
|
end
|
40
46
|
|
41
47
|
# We need last sinatra that uses rack 2.x
|
42
48
|
gem 'sinatra', :git => 'https://github.com/sinatra/sinatra'
|
43
49
|
|
44
|
-
gem '
|
45
|
-
gem 'database_cleaner', '~> 1.x'
|
50
|
+
gem 'database_cleaner'
|
46
51
|
gem 'delayed_job', :require => false
|
47
52
|
gem 'generator_spec'
|
48
53
|
gem 'girl_friday', '>= 0.11.1'
|
49
54
|
gem 'redis'
|
50
55
|
gem 'resque'
|
51
56
|
|
57
|
+
unless is_jruby
|
58
|
+
# JRuby doesn't support fork, which is required for this test helper.
|
59
|
+
gem 'rspec-command'
|
60
|
+
end
|
61
|
+
|
52
62
|
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
|
53
63
|
gem 'mime-types', '< 3.0'
|
54
64
|
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'rubygems/version'
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
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
|
+
|
12
|
+
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
|
13
|
+
|
14
|
+
gem 'appraisal'
|
15
|
+
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
|
16
|
+
gem 'jruby-openssl', :platform => :jruby
|
17
|
+
gem 'rails', '~> 5.2.3'
|
18
|
+
gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
|
19
|
+
|
20
|
+
gem 'rspec-core', '~> 3.8.0'
|
21
|
+
gem 'rspec-rails', '~> 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
|
+
|
26
|
+
gem 'rake'
|
27
|
+
|
28
|
+
gem 'sidekiq', '>= 2.13.0'
|
29
|
+
|
30
|
+
platforms :rbx do
|
31
|
+
gem 'minitest'
|
32
|
+
gem 'racc'
|
33
|
+
gem 'rubinius-developer_tools'
|
34
|
+
gem 'rubysl', '~> 2.0' unless RUBY_VERSION.start_with?('1')
|
35
|
+
end
|
36
|
+
|
37
|
+
gem 'sucker_punch', '~> 2.0'
|
38
|
+
|
39
|
+
# We need last sinatra that uses rack 2.x
|
40
|
+
gem 'sinatra', :git => 'https://github.com/sinatra/sinatra'
|
41
|
+
|
42
|
+
gem 'database_cleaner'
|
43
|
+
gem 'codacy-coverage'
|
44
|
+
gem 'delayed_job', :require => false
|
45
|
+
gem 'generator_spec'
|
46
|
+
gem 'girl_friday', '>= 0.11.1'
|
47
|
+
gem 'redis'
|
48
|
+
gem 'resque'
|
49
|
+
gem 'simplecov'
|
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
|
+
|
56
|
+
gem 'mime-types'
|
57
|
+
|
58
|
+
gem 'webmock', :require => false
|
59
|
+
|
60
|
+
gem 'aws-sdk-sqs'
|
61
|
+
gem 'shoryuken'
|
62
|
+
|
63
|
+
gem 'capistrano', :require => false
|
64
|
+
|
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.0.rc1'
|
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 => '../'
|
data/lib/rails/rollbar_runner.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
require 'rails'
|
2
2
|
require 'rollbar'
|
3
3
|
|
4
|
-
|
4
|
+
# Rails.root is not present here.
|
5
|
+
# RSpec needs ENV['DUMMYAPP_PATH'] in order to have a valid path.
|
6
|
+
# Dir.pwd is used in normal operation.
|
7
|
+
APP_PATH = File.expand_path('config/application', (ENV['DUMMYAPP_PATH'] || Dir.pwd))
|
5
8
|
|
6
9
|
module Rails
|
7
10
|
class RollbarRunner
|
@@ -36,6 +39,14 @@ module Rails
|
|
36
39
|
end
|
37
40
|
|
38
41
|
def eval_runner
|
42
|
+
if Rails.version >= '5.1.0'
|
43
|
+
rails5_runner
|
44
|
+
else
|
45
|
+
legacy_runner
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def legacy_runner
|
39
50
|
string_to_eval = File.read(runner_path)
|
40
51
|
|
41
52
|
::Rails.module_eval(<<-EOL, __FILE__, __LINE__ + 2)
|
@@ -43,9 +54,13 @@ module Rails
|
|
43
54
|
EOL
|
44
55
|
end
|
45
56
|
|
57
|
+
def rails5_runner
|
58
|
+
Rails::Command.invoke 'runner', ARGV
|
59
|
+
end
|
60
|
+
|
46
61
|
def rollbar_managed
|
47
62
|
yield
|
48
|
-
rescue => e
|
63
|
+
rescue StandardError => e
|
49
64
|
Rollbar.scope(:custom => { :command => command }).error(e)
|
50
65
|
raise
|
51
66
|
end
|
data/lib/rollbar.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'net/protocol'
|
2
2
|
require 'net/https'
|
3
3
|
require 'socket'
|
4
|
-
require 'thread'
|
5
4
|
require 'uri'
|
6
5
|
require 'open-uri'
|
7
6
|
require 'forwardable'
|
@@ -22,10 +21,10 @@ require 'rollbar/notifier'
|
|
22
21
|
# The Rollbar module. It stores a Rollbar::Notifier per thread and
|
23
22
|
# provides some module methods in order to use the current thread notifier.
|
24
23
|
module Rollbar
|
25
|
-
PUBLIC_NOTIFIER_METHODS = %w
|
24
|
+
PUBLIC_NOTIFIER_METHODS = %w[debug info warn warning error critical log logger
|
26
25
|
process_item process_from_async_handler scope
|
27
26
|
send_failsafe log_info log_debug log_warning
|
28
|
-
log_error silenced scope_object
|
27
|
+
log_error silenced scope_object].freeze
|
29
28
|
|
30
29
|
class << self
|
31
30
|
extend Forwardable
|
data/lib/rollbar/capistrano.rb
CHANGED
@@ -1,43 +1,77 @@
|
|
1
|
+
# This is a tasks file to use with Capistrano 2
|
2
|
+
|
1
3
|
require 'capistrano'
|
4
|
+
require 'rollbar/deploy'
|
5
|
+
require 'net/http'
|
6
|
+
require 'rubygems'
|
7
|
+
require 'json'
|
8
|
+
require 'rollbar/capistrano_tasks'
|
2
9
|
|
3
10
|
module Rollbar
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |http|
|
36
|
-
http.request(request)
|
37
|
-
end
|
38
|
-
end
|
11
|
+
# Module for loading Rollbar Capistrano tasks into Capistrano 2
|
12
|
+
module Capistrano2
|
13
|
+
class << self
|
14
|
+
def load_into(configuration)
|
15
|
+
load_tasks(configuration)
|
16
|
+
load_tasks_flow(configuration)
|
17
|
+
load_properties(configuration)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def load_tasks_flow(configuration)
|
23
|
+
configuration.load do
|
24
|
+
before 'deploy', 'rollbar:deploy_started'
|
25
|
+
|
26
|
+
after 'deploy', 'rollbar:deploy_succeeded'
|
27
|
+
after 'deploy:migrations', 'rollbar:deploy_succeeded'
|
28
|
+
after 'deploy:cold', 'rollbar:deploy_succeeded'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def load_properties(configuration)
|
33
|
+
configuration.load do
|
34
|
+
_cset(:rollbar_role) { :app }
|
35
|
+
_cset(:rollbar_user) { ENV['USER'] || ENV['USERNAME'] }
|
36
|
+
_cset(:rollbar_env) { fetch(:rails_env, 'production') }
|
37
|
+
_cset(:rollbar_token) { abort("Please specify the Rollbar access token, set :rollbar_token, 'your token'") }
|
38
|
+
_cset(:rollbar_revision) { current_revision }
|
39
|
+
_cset(:rollbar_comment) { nil }
|
40
|
+
end
|
41
|
+
end
|
39
42
|
|
40
|
-
|
43
|
+
def load_tasks(configuration)
|
44
|
+
load_deploy_started(configuration)
|
45
|
+
load_deploy_succeeded(configuration)
|
46
|
+
end
|
47
|
+
|
48
|
+
def load_deploy_started(configuration)
|
49
|
+
load_task(
|
50
|
+
:desc => 'Send deployment started notification to Rollbar.',
|
51
|
+
:task => :deploy_started,
|
52
|
+
:configuration => configuration
|
53
|
+
) do
|
54
|
+
::Rollbar::CapistranoTasks.deploy_started(configuration, configuration.logger, configuration.dry_run)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def load_deploy_succeeded(configuration)
|
59
|
+
load_task(
|
60
|
+
:desc => 'Send deployment succeeded notification to Rollbar.',
|
61
|
+
:task => :deploy_succeeded,
|
62
|
+
:configuration => configuration
|
63
|
+
) do
|
64
|
+
::Rollbar::CapistranoTasks.deploy_succeeded(configuration, configuration.logger, configuration.dry_run)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def load_task(configuration:, desc:, task:)
|
69
|
+
configuration.load do
|
70
|
+
namespace :rollbar do
|
71
|
+
desc(desc)
|
72
|
+
task(task) do
|
73
|
+
yield
|
74
|
+
end
|
41
75
|
end
|
42
76
|
end
|
43
77
|
end
|
@@ -45,6 +79,4 @@ module Rollbar
|
|
45
79
|
end
|
46
80
|
end
|
47
81
|
|
48
|
-
if Capistrano::Configuration.instance
|
49
|
-
Rollbar::Capistrano.load_into(Capistrano::Configuration.instance)
|
50
|
-
end
|
82
|
+
Rollbar::Capistrano2.load_into(Capistrano::Configuration.instance) if Capistrano::Configuration.instance
|