rollbar 2.11.3 → 2.11.4
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 +6 -0
- data/README.md +9 -1
- data/data/rollbar.snippet.js +1 -1
- data/lib/rollbar/middleware/rails/show_exceptions.rb +5 -2
- data/lib/rollbar/plugin.rb +16 -1
- data/lib/rollbar/version.rb +1 -1
- data/spec/rollbar/plugin_spec.rb +62 -0
- 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: 1949eb5f439a279954e6866534c8d7acf4499421
|
|
4
|
+
data.tar.gz: d8ba4a67a39ab23e32af45f973fa53864328864c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4303f9cd437d8611c5f47e1a014ea686982bee5e2cf7b4c4ca7e266506fb3b9389e7d37acec011224e28f74c29ab0fabd9a2fb5344383fdb72be8665bb104585
|
|
7
|
+
data.tar.gz: 10f3cc2f1ce4d17ce6bdb98c5562e03e6ce4d6d397d9878627d69aa227ebdf6e43a769dec9ec0fae265df138e95c3f1411b49f785dac0ef18d0ca12383bdd03b
|
data/CHANGELOG.md
CHANGED
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.
|
|
@@ -680,6 +680,14 @@ The default Sidekiq queue will be `rollbar` but you can also supply custom Sidek
|
|
|
680
680
|
config.use_sidekiq 'queue' => 'default'
|
|
681
681
|
```
|
|
682
682
|
|
|
683
|
+
You also need to add the name of the queue to your `sidekiq.yml`
|
|
684
|
+
|
|
685
|
+
```
|
|
686
|
+
:queues:
|
|
687
|
+
- default
|
|
688
|
+
- rollbar
|
|
689
|
+
```
|
|
690
|
+
|
|
683
691
|
Start the redis server:
|
|
684
692
|
|
|
685
693
|
```bash
|
data/data/rollbar.snippet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(r){function
|
|
1
|
+
!function(r){function e(t){if(o[t])return o[t].exports;var n=o[t]={exports:{},id:t,loaded:!1};return r[t].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var o={};return e.m=r,e.c=o,e.p="",e(0)}([function(r,e,o){"use strict";var t=o(1).Rollbar,n=o(2);_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://d37gvrvc0wt4s1.cloudfront.net/js/v1.9/rollbar.min.js";var a=t.init(window,_rollbarConfig),i=n(a,_rollbarConfig);a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,i)},function(r,e){"use strict";function o(r){return function(){try{return r.apply(this,arguments)}catch(e){try{console.error("[Rollbar]: Internal error",e)}catch(o){}}}}function t(r,e,o){window._rollbarWrappedError&&(o[4]||(o[4]=window._rollbarWrappedError),o[5]||(o[5]=window._rollbarWrappedError._rollbarContext),window._rollbarWrappedError=null),r.uncaughtError.apply(r,o),e&&e.apply(window,o)}function n(r){var e=function(){var e=Array.prototype.slice.call(arguments,0);t(r,r._rollbarOldOnError,e)};return e.belongsToShim=!0,e}function a(r){this.shimId=++c,this.notifier=null,this.parentShim=r,this._rollbarOldOnError=null}function i(r){var e=a;return o(function(){if(this.notifier)return this.notifier[r].apply(this.notifier,arguments);var o=this,t="scope"===r;t&&(o=new e(this));var n=Array.prototype.slice.call(arguments,0),a={shim:o,method:r,args:n,ts:new Date};return window._rollbarShimQueue.push(a),t?o:void 0})}function l(r,e){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){var o=e.addEventListener;e.addEventListener=function(e,t,n){o.call(this,e,r.wrap(t),n)};var t=e.removeEventListener;e.removeEventListener=function(r,e,o){t.call(this,r,e&&e._wrapped?e._wrapped:e,o)}}}var c=0;a.init=function(r,e){var t=e.globalAlias||"Rollbar";if("object"==typeof r[t])return r[t];r._rollbarShimQueue=[],r._rollbarWrappedError=null,e=e||{};var i=new a;return o(function(){if(i.configure(e),e.captureUncaught){i._rollbarOldOnError=r.onerror,r.onerror=n(i);var o,a,c="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(o=0;o<c.length;++o)a=c[o],r[a]&&r[a].prototype&&l(i,r[a].prototype)}return e.captureUnhandledRejections&&(i._unhandledRejectionHandler=function(r){var e=r.reason,o=r.promise,t=r.detail;!e&&t&&(e=t.reason,o=t.promise),i.unhandledRejection(e,o)},r.addEventListener("unhandledrejection",i._unhandledRejectionHandler)),r[t]=i,i})()},a.prototype.loadFull=function(r,e,t,n,a){var i=function(){var e;if(void 0===r._rollbarPayloadQueue){var o,t,n,i;for(e=new Error("rollbar.js did not load");o=r._rollbarShimQueue.shift();)for(n=o.args,i=0;i<n.length;++i)if(t=n[i],"function"==typeof t){t(e);break}}"function"==typeof a&&a(e)},l=!1,c=e.createElement("script"),d=e.getElementsByTagName("script")[0],p=d.parentNode;c.crossOrigin="",c.src=n.rollbarJsUrl,c.async=!t,c.onload=c.onreadystatechange=o(function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){c.onload=c.onreadystatechange=null;try{p.removeChild(c)}catch(r){}l=!0,i()}}),p.insertBefore(c,d)},a.prototype.wrap=function(r,e){try{var o;if(o="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._wrapped){r._wrapped=function(){try{return r.apply(this,arguments)}catch(e){throw e._rollbarContext=o()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e,e}},r._wrapped._isWrap=!0;for(var t in r)r.hasOwnProperty(t)&&(r._wrapped[t]=r[t])}return r._wrapped}catch(n){return r}};for(var d="log,debug,info,warn,warning,error,critical,global,configure,scope,uncaughtError,unhandledRejection".split(","),p=0;p<d.length;++p)a.prototype[d[p]]=i(d[p]);r.exports={Rollbar:a,_rollbarWindowOnError:t}},function(r,e){"use strict";r.exports=function(r,e){return function(o){if(!o&&!window._rollbarInitialized){var t=window.RollbarNotifier,n=e||{},a=n.globalAlias||"Rollbar",i=window.Rollbar.init(n,r);i._processShimQueue(window._rollbarShimQueue||[]),window[a]=i,window._rollbarInitialized=!0,t.processPayloads()}}}}]);
|
|
@@ -39,8 +39,11 @@ module Rollbar
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def self.included(base)
|
|
42
|
-
base.send(:
|
|
43
|
-
base.send(:
|
|
42
|
+
base.send(:alias_method, :call_without_rollbar, :call)
|
|
43
|
+
base.send(:alias_method, :call, :call_with_rollbar)
|
|
44
|
+
|
|
45
|
+
base.send(:alias_method, :render_exception_without_rollbar, :render_exception)
|
|
46
|
+
base.send(:alias_method, :render_exception, :render_exception_with_rollbar)
|
|
44
47
|
end
|
|
45
48
|
end
|
|
46
49
|
end
|
data/lib/rollbar/plugin.rb
CHANGED
|
@@ -48,14 +48,29 @@ module Rollbar
|
|
|
48
48
|
dependencies << block
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
def require_dependency(file)
|
|
52
|
+
dependency do
|
|
53
|
+
begin
|
|
54
|
+
require file
|
|
55
|
+
true
|
|
56
|
+
rescue LoadError
|
|
57
|
+
false
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
51
62
|
def load?
|
|
52
|
-
!loaded &&
|
|
63
|
+
!loaded && dependencies_satisfy?
|
|
53
64
|
rescue => e
|
|
54
65
|
log_loading_error(e)
|
|
55
66
|
|
|
56
67
|
false
|
|
57
68
|
end
|
|
58
69
|
|
|
70
|
+
def dependencies_satisfy?
|
|
71
|
+
dependencies.all?(&:call)
|
|
72
|
+
end
|
|
73
|
+
|
|
59
74
|
def log_loading_error(e)
|
|
60
75
|
Rollbar.log_error("Error trying to load plugin '#{name}': #{e.class}, #{e.message}")
|
|
61
76
|
end
|
data/lib/rollbar/version.rb
CHANGED
data/spec/rollbar/plugin_spec.rb
CHANGED
|
@@ -7,6 +7,68 @@ describe Rollbar::Plugin do
|
|
|
7
7
|
|
|
8
8
|
before { subject.instance_eval(&plugin_proc) }
|
|
9
9
|
|
|
10
|
+
context 'with requires not passing' do
|
|
11
|
+
let(:dummy_object) { '' }
|
|
12
|
+
let(:plugin_proc) do
|
|
13
|
+
dummy = dummy_object
|
|
14
|
+
|
|
15
|
+
proc do
|
|
16
|
+
require_dependency('rollbar')
|
|
17
|
+
dependency do
|
|
18
|
+
true
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
execute do
|
|
22
|
+
dummy.upcase
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
execute do
|
|
26
|
+
dummy.downcase
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it 'doesnt finish loading the plugin' do
|
|
32
|
+
expect(dummy_object).to receive(:upcase)
|
|
33
|
+
expect(dummy_object).to receive(:downcase)
|
|
34
|
+
|
|
35
|
+
subject.load!
|
|
36
|
+
|
|
37
|
+
expect(subject.loaded).to be_eql(true)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
context 'with requires not passing' do
|
|
42
|
+
let(:dummy_object) { '' }
|
|
43
|
+
let(:plugin_proc) do
|
|
44
|
+
dummy = dummy_object
|
|
45
|
+
|
|
46
|
+
proc do
|
|
47
|
+
require_dependency('sure-this-doesnt-exists')
|
|
48
|
+
dependency do
|
|
49
|
+
true
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
execute do
|
|
53
|
+
dummy.upcase
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
execute do
|
|
57
|
+
dummy.downcase
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
it 'doesnt finish loading the plugin' do
|
|
63
|
+
expect(dummy_object).not_to receive(:upcase)
|
|
64
|
+
expect(dummy_object).not_to receive(:downcase)
|
|
65
|
+
|
|
66
|
+
subject.load!
|
|
67
|
+
|
|
68
|
+
expect(subject.loaded).to be_eql(false)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
10
72
|
context 'with true dependencies' do
|
|
11
73
|
let(:dummy_object) { '' }
|
|
12
74
|
let(:plugin_proc) do
|
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.11.
|
|
4
|
+
version: 2.11.4
|
|
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-05-
|
|
11
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: multi_json
|