rollbar 2.11.3 → 2.11.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5851703f65adab5176d10107ece8d7c0aea9930
4
- data.tar.gz: 27544951ae368273b0a9c43c2d992c0636561197
3
+ metadata.gz: 1949eb5f439a279954e6866534c8d7acf4499421
4
+ data.tar.gz: d8ba4a67a39ab23e32af45f973fa53864328864c
5
5
  SHA512:
6
- metadata.gz: a33f0936c4f77db669960680feba1f838e90262d033f9d5c5306dc9d74671e748c1aac35536d4ec4e35f3873e60537e130a8dcbdca60af3bc03cd39055997421
7
- data.tar.gz: da71d51b05f98ee19d2dd75fdd451474587e16772b3718a77b92f29f3d5a74d7f0d0194ebd3abc4fda7fd5dff979ff78c1af975fec9fe2e9a9496e3e1fbd00fa
6
+ metadata.gz: 4303f9cd437d8611c5f47e1a014ea686982bee5e2cf7b4c4ca7e266506fb3b9389e7d37acec011224e28f74c29ab0fabd9a2fb5344383fdb72be8665bb104585
7
+ data.tar.gz: 10f3cc2f1ce4d17ce6bdb98c5562e03e6ce4d6d397d9878627d69aa227ebdf6e43a769dec9ec0fae265df138e95c3f1411b49f785dac0ef18d0ca12383bdd03b
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 2.11.4
4
+
5
+ Change:
6
+
7
+ - Update rollbar.js snippet
8
+
3
9
  ## 2.11.3
4
10
 
5
11
  Fix:
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Rollbar [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=v2.11.3)](https://travis-ci.org/rollbar/rollbar-gem/branches)
1
+ # Rollbar [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=v2.11.4)](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
@@ -1 +1 @@
1
- !function(r){function o(e){if(t[e])return t[e].exports;var n=t[e]={exports:{},id:e,loaded:!1};return r[e].call(n.exports,n,n.exports,o),n.loaded=!0,n.exports}var t={};return o.m=r,o.c=t,o.p="",o(0)}([function(r,o,t){"use strict";var e=t(1).Rollbar,n=t(2);_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://d37gvrvc0wt4s1.cloudfront.net/js/v1.8/rollbar.min.js";var a=e.init(window,_rollbarConfig),i=n(a,_rollbarConfig);a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,i)},function(r,o){"use strict";function t(r){return function(){try{return r.apply(this,arguments)}catch(o){try{console.error("[Rollbar]: Internal error",o)}catch(t){}}}}function e(r,o,t){window._rollbarWrappedError&&(t[4]||(t[4]=window._rollbarWrappedError),t[5]||(t[5]=window._rollbarWrappedError._rollbarContext),window._rollbarWrappedError=null),r.uncaughtError.apply(r,t),o&&o.apply(window,t)}function n(r){var o=function(){var o=Array.prototype.slice.call(arguments,0);e(r,r._rollbarOldOnError,o)};return o.belongsToShim=!0,o}function a(r){this.shimId=++s,this.notifier=null,this.parentShim=r,this._rollbarOldOnError=null}function i(r){var o=a;return t(function(){if(this.notifier)return this.notifier[r].apply(this.notifier,arguments);var t=this,e="scope"===r;e&&(t=new o(this));var n=Array.prototype.slice.call(arguments,0),a={shim:t,method:r,args:n,ts:new Date};return window._rollbarShimQueue.push(a),e?t:void 0})}function l(r,o){if(o.hasOwnProperty&&o.hasOwnProperty("addEventListener")){var t=o.addEventListener;o.addEventListener=function(o,e,n){t.call(this,o,r.wrap(e),n)};var e=o.removeEventListener;o.removeEventListener=function(r,o,t){e.call(this,r,o&&o._wrapped?o._wrapped:o,t)}}}var s=0;a.init=function(r,o){var e=o.globalAlias||"Rollbar";if("object"==typeof r[e])return r[e];r._rollbarShimQueue=[],r._rollbarWrappedError=null,o=o||{};var i=new a;return t(function(){if(i.configure(o),o.captureUncaught){i._rollbarOldOnError=r.onerror,r.onerror=n(i);var t,a,s="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(t=0;t<s.length;++t)a=s[t],r[a]&&r[a].prototype&&l(i,r[a].prototype)}return r[e]=i,i})()},a.prototype.loadFull=function(r,o,e,n,a){var i=function(){var o;if(void 0===r._rollbarPayloadQueue){var t,e,n,i;for(o=new Error("rollbar.js did not load");t=r._rollbarShimQueue.shift();)for(n=t.args,i=0;i<n.length;++i)if(e=n[i],"function"==typeof e){e(o);break}}"function"==typeof a&&a(o)},l=!1,s=o.createElement("script"),u=o.getElementsByTagName("script")[0],p=u.parentNode;s.crossOrigin="",s.src=n.rollbarJsUrl,s.async=!e,s.onload=s.onreadystatechange=t(function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){s.onload=s.onreadystatechange=null;try{p.removeChild(s)}catch(r){}l=!0,i()}}),p.insertBefore(s,u)},a.prototype.wrap=function(r,o){try{var t;if(t="function"==typeof o?o:function(){return o||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._wrapped){r._wrapped=function(){try{return r.apply(this,arguments)}catch(o){throw o._rollbarContext=t()||{},o._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=o,o}},r._wrapped._isWrap=!0;for(var e in r)r.hasOwnProperty(e)&&(r._wrapped[e]=r[e])}return r._wrapped}catch(n){return r}};for(var u="log,debug,info,warn,warning,error,critical,global,configure,scope,uncaughtError".split(","),p=0;p<u.length;++p)a.prototype[u[p]]=i(u[p]);r.exports={Rollbar:a,_rollbarWindowOnError:e}},function(r,o){"use strict";r.exports=function(r,o){return function(t){if(!t&&!window._rollbarInitialized){var e=window.RollbarNotifier,n=o||{},a=n.globalAlias||"Rollbar",i=window.Rollbar.init(n,r);i._processShimQueue(window._rollbarShimQueue||[]),window[a]=i,window._rollbarInitialized=!0,e.processPayloads()}}}}]);
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(:alias_method_chain, :call, :rollbar)
43
- base.send(:alias_method_chain, :render_exception, :rollbar)
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
@@ -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 && dependencies.all?(&:call)
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
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = '2.11.3'
2
+ VERSION = '2.11.4'
3
3
  end
@@ -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.3
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-09 00:00:00.000000000 Z
11
+ date: 2016-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json