rollbar 2.13.0 → 2.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +3 -1
- data/lib/rollbar/notifier.rb +20 -17
- data/lib/rollbar/rake_tasks.rb +37 -42
- data/lib/rollbar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a27c812bcbc48208ec5968eaae3a20ef863b43a
|
4
|
+
data.tar.gz: f6d8171c122522d4f9f44caf1971fb0fa7e1fd94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed6a83b65c5a09f55c5605c94adcc18d015bb9691f1ca608c5bb2c0d869ae2ac1f720b12fcb4c50df26fd8c316757c9f5914574ca98dd724f70e6ca30fddfdc0
|
7
|
+
data.tar.gz: 776e79159576228d00a385c4650499da8e7ae7e5bda62e342f27eb94ec7f7b651335b9a477a29db0cda2634f456c35eb828fb81ea1ef5d1ed411bbb58cf77ecb
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 2.13.1
|
4
|
+
|
5
|
+
Fixes:
|
6
|
+
|
7
|
+
- Inherit test controller from ActionController::Base
|
8
|
+
- Fix test rake task when Rack::MockRequest is not defined
|
9
|
+
- Fix docs for Sinatra middleware
|
10
|
+
- Fix few basic rubocop offenses
|
11
|
+
|
3
12
|
## 2.13.0
|
4
13
|
|
5
14
|
Features:
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Rollbar [](https://travis-ci.org/rollbar/rollbar-gem/branches)
|
2
2
|
|
3
3
|
<!-- RemoveNext -->
|
4
4
|
[Rollbar](https://rollbar.com) is an error tracking service for Ruby and other languages. The Rollbar service will alert you of problems with your code and help you understand them in a ways never possible before. We love it and we hope you will too.
|
@@ -153,6 +153,8 @@ end
|
|
153
153
|
Then mount the middleware in your app, like:
|
154
154
|
|
155
155
|
```ruby
|
156
|
+
require 'rollbar/middleware/sinatra'
|
157
|
+
|
156
158
|
class MyApp < Sinatra::Base
|
157
159
|
use Rollbar::Middleware::Sinatra
|
158
160
|
# other middleware/etc
|
data/lib/rollbar/notifier.rb
CHANGED
@@ -11,6 +11,8 @@ require 'rollbar/logger_proxy'
|
|
11
11
|
require 'rollbar/item'
|
12
12
|
|
13
13
|
module Rollbar
|
14
|
+
# The notifier class. It has the core functionality
|
15
|
+
# for sending reports to the API.
|
14
16
|
class Notifier
|
15
17
|
attr_accessor :configuration
|
16
18
|
attr_accessor :last_report
|
@@ -140,7 +142,7 @@ module Rollbar
|
|
140
142
|
|
141
143
|
begin
|
142
144
|
report(level, message, exception, extra)
|
143
|
-
rescue
|
145
|
+
rescue StandardError, SystemStackError => e
|
144
146
|
report_internal_error(e)
|
145
147
|
|
146
148
|
'error'
|
@@ -180,9 +182,9 @@ module Rollbar
|
|
180
182
|
def process_item(item)
|
181
183
|
if configuration.write_to_file
|
182
184
|
if configuration.use_async
|
183
|
-
@file_semaphore.synchronize
|
185
|
+
@file_semaphore.synchronize do
|
184
186
|
write_item(item)
|
185
|
-
|
187
|
+
end
|
186
188
|
else
|
187
189
|
write_item(item)
|
188
190
|
end
|
@@ -383,26 +385,26 @@ module Rollbar
|
|
383
385
|
# Rollbar project. We'll first attempt to provide a report including the exception traceback.
|
384
386
|
# If that fails, we'll fall back to a more static failsafe response.
|
385
387
|
def report_internal_error(exception)
|
386
|
-
log_error
|
388
|
+
log_error '[Rollbar] Reporting internal error encountered while sending data to Rollbar.'
|
387
389
|
|
388
390
|
begin
|
389
|
-
item = build_item('error', nil, exception,
|
391
|
+
item = build_item('error', nil, exception, :internal => true)
|
390
392
|
rescue => e
|
391
|
-
send_failsafe(
|
393
|
+
send_failsafe('build_item in exception_data', e)
|
392
394
|
return
|
393
395
|
end
|
394
396
|
|
395
397
|
begin
|
396
398
|
process_item(item)
|
397
399
|
rescue => e
|
398
|
-
send_failsafe(
|
400
|
+
send_failsafe('error in process_item', e)
|
399
401
|
return
|
400
402
|
end
|
401
403
|
|
402
404
|
begin
|
403
405
|
log_instance_link(item['data'])
|
404
406
|
rescue => e
|
405
|
-
send_failsafe(
|
407
|
+
send_failsafe('error logging instance link', e)
|
406
408
|
return
|
407
409
|
end
|
408
410
|
end
|
@@ -475,7 +477,7 @@ module Rollbar
|
|
475
477
|
if uri.scheme == 'https'
|
476
478
|
http.use_ssl = true
|
477
479
|
# This is needed to have 1.8.7 passing tests
|
478
|
-
http.ca_file = ENV['ROLLBAR_SSL_CERT_FILE'] if ENV.
|
480
|
+
http.ca_file = ENV['ROLLBAR_SSL_CERT_FILE'] if ENV.key?('ROLLBAR_SSL_CERT_FILE')
|
479
481
|
http.verify_mode = ssl_verify_mode
|
480
482
|
end
|
481
483
|
|
@@ -526,9 +528,9 @@ module Rollbar
|
|
526
528
|
|
527
529
|
def write_item(item)
|
528
530
|
if configuration.use_async
|
529
|
-
@file_semaphore.synchronize
|
531
|
+
@file_semaphore.synchronize do
|
530
532
|
do_write_item(item)
|
531
|
-
|
533
|
+
end
|
532
534
|
else
|
533
535
|
do_write_item(item)
|
534
536
|
end
|
@@ -541,13 +543,12 @@ module Rollbar
|
|
541
543
|
return unless body
|
542
544
|
|
543
545
|
begin
|
544
|
-
|
545
|
-
@file = File.open(configuration.filepath, "a")
|
546
|
-
end
|
546
|
+
@file ||= File.open(configuration.filepath, 'a')
|
547
547
|
|
548
548
|
@file.puts(body)
|
549
549
|
@file.flush
|
550
|
-
|
550
|
+
|
551
|
+
log_info '[Rollbar] Success'
|
551
552
|
rescue IOError => e
|
552
553
|
log_error "[Rollbar] Error opening/writing to file: #{e}"
|
553
554
|
end
|
@@ -563,16 +564,18 @@ module Rollbar
|
|
563
564
|
|
564
565
|
exception_info = exception.class.name
|
565
566
|
# #to_s and #message defaults to class.to_s. Add message only if add valuable info.
|
566
|
-
exception_info += %
|
567
|
+
exception_info += %(: "#{exception.message}") if exception.message != exception.class.to_s
|
567
568
|
exception_info += " in #{nearest_frame}" if nearest_frame
|
568
569
|
|
569
570
|
body += "#{exception_info}: #{message}"
|
570
571
|
rescue
|
572
|
+
log_error('[Rollbar] Error building failsafe exception message')
|
571
573
|
end
|
572
574
|
else
|
573
575
|
begin
|
574
576
|
body += message.to_s
|
575
577
|
rescue
|
578
|
+
log_error('[Rollbar] Error building failsafe message')
|
576
579
|
end
|
577
580
|
end
|
578
581
|
|
@@ -604,7 +607,7 @@ module Rollbar
|
|
604
607
|
def process_async_item(item)
|
605
608
|
configuration.async_handler ||= default_async_handler
|
606
609
|
configuration.async_handler.call(item.payload)
|
607
|
-
rescue
|
610
|
+
rescue
|
608
611
|
if configuration.failover_handlers.empty?
|
609
612
|
log_error '[Rollbar] Async handler failed, and there are no failover handlers configured. See the docs for "failover_handlers"'
|
610
613
|
return
|
data/lib/rollbar/rake_tasks.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
require 'rollbar'
|
2
|
-
|
2
|
+
begin
|
3
|
+
require 'rack/mock'
|
4
|
+
rescue LoadError
|
5
|
+
end
|
3
6
|
require 'logger'
|
4
7
|
|
5
8
|
namespace :rollbar do
|
@@ -39,60 +42,52 @@ namespace :rollbar do
|
|
39
42
|
end
|
40
43
|
end
|
41
44
|
|
42
|
-
if defined?(
|
43
|
-
|
44
|
-
|
45
|
-
rescue LoadError
|
46
|
-
end
|
47
|
-
|
48
|
-
unless defined?(ApplicationController)
|
49
|
-
puts 'No ApplicationController found, using ActionController::Base instead'
|
50
|
-
class ApplicationController < ActionController::Base; end
|
51
|
-
end
|
45
|
+
if defined?(Rack::MockRequest)
|
46
|
+
if defined?(Rails)
|
47
|
+
puts 'Setting up the controller.'
|
52
48
|
|
53
|
-
|
49
|
+
class RollbarTestController < ActionController::Base
|
50
|
+
include RollbarTest
|
54
51
|
|
55
|
-
|
56
|
-
|
52
|
+
def verify
|
53
|
+
test_rollbar
|
54
|
+
end
|
57
55
|
|
58
|
-
|
59
|
-
|
56
|
+
def logger
|
57
|
+
nil
|
58
|
+
end
|
60
59
|
end
|
61
60
|
|
62
|
-
|
63
|
-
|
61
|
+
Rails.application.routes_reloader.execute_if_updated
|
62
|
+
Rails.application.routes.draw do
|
63
|
+
get 'verify' => 'rollbar_test#verify', :as => 'verify'
|
64
64
|
end
|
65
|
-
end
|
66
65
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
# from http://stackoverflow.com/questions/5270835/authlogic-activation-problems
|
73
|
-
if defined? Authlogic
|
74
|
-
Authlogic::Session::Base.controller = Authlogic::ControllerAdapters::RailsAdapter.new(self)
|
75
|
-
end
|
66
|
+
# from http://stackoverflow.com/questions/5270835/authlogic-activation-problems
|
67
|
+
if defined? Authlogic
|
68
|
+
Authlogic::Session::Base.controller = Authlogic::ControllerAdapters::RailsAdapter.new(self)
|
69
|
+
end
|
76
70
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
71
|
+
protocol = (defined? Rails.application.config.force_ssl && Rails.application.config.force_ssl) ? 'https' : 'http'
|
72
|
+
app = Rails.application
|
73
|
+
else
|
74
|
+
protocol = 'http'
|
75
|
+
app = Class.new do
|
76
|
+
include RollbarTest
|
83
77
|
|
84
|
-
|
85
|
-
|
78
|
+
def self.call(_env)
|
79
|
+
new.test_rollbar
|
80
|
+
end
|
86
81
|
end
|
87
82
|
end
|
88
|
-
end
|
89
83
|
|
90
|
-
|
91
|
-
|
92
|
-
|
84
|
+
puts 'Processing...'
|
85
|
+
env = Rack::MockRequest.env_for("#{protocol}://www.example.com/verify")
|
86
|
+
status, = app.call(env)
|
93
87
|
|
94
|
-
|
95
|
-
|
88
|
+
unless status.to_i == 500
|
89
|
+
puts 'Test failed! You may have a configuration issue, or you could be using a gem that\'s blocking the test. Contact support@rollbar.com if you need help troubleshooting.'
|
90
|
+
end
|
96
91
|
end
|
97
92
|
end
|
98
93
|
end
|
data/lib/rollbar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rollbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.13.
|
4
|
+
version: 2.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rollbar, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|