rollbar 2.23.0 → 2.25.1

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
  SHA256:
3
- metadata.gz: a50cc143ea1aa3a6add2c00d309896a3710a46badb9766bbe483493573ed3529
4
- data.tar.gz: 0b0adcbf6fe2c7f34d45a637b1094635d02549a1b482f20ca6d2fcc8f61c794b
3
+ metadata.gz: 5bffe91029b00ca56f007756a93e94cdfb22ae068983b7d81c8f5b8dd168de41
4
+ data.tar.gz: 5f75d00b9b6f8910fb0d7c8de71f30efde6b00132927b01746811d101b5a4dc2
5
5
  SHA512:
6
- metadata.gz: bfa2037aa71e31c48c8bbe1ee8b4fec69225ee705500bdf04c9f872188d721571d58e60c7ddcc1783b778a2182c0dfd8a27be22e3cd76143a9964a2ad873dcef
7
- data.tar.gz: 0f1dd72f99f40672c779bcaf2750c1e0aa7a094fb205bc750fa32ea3d6d2121ac9852f43d0b69ce5543d851ac3c72723e0e5579330e1de7de00058605c58ee60
6
+ metadata.gz: ff7f880b5749d41a349ffa441198d495f13b450712c79a407b9569f091161ca06fdd5c3db08068d05a970745d629e99ed258de770cb8a973e3c3834a66d0592c
7
+ data.tar.gz: 740de4df537388a5a52280c2aebb5f2286849dc70589baa20dd587518a49334e8a10f28c2caa6540b1c45dbcf24c1c46652f90c35395c51bba7ae9d154bb3c64
@@ -51,7 +51,7 @@ Style/Documentation:
51
51
  # As is, we currently add :nodoc: if anything at all.
52
52
  Enabled: false
53
53
 
54
- Naming/UncommunicativeMethodParamName:
54
+ Naming/MethodParameterName:
55
55
  # It's possible to configure this cop to allow just about anything, but what's the point.
56
56
  # The default min length of a param name is 3, but the the default whitelist includes things
57
57
  # like `db` and `io`. So, short names really can be useful.
@@ -69,6 +69,10 @@ Style/FrozenStringLiteralComment:
69
69
  # throughout the project, in order to prepare for a future Ruby 3.x.
70
70
  Enabled: false
71
71
 
72
+ Style/SafeNavigation:
73
+ # Not available in Ruby < 2.3.
74
+ Enabled: false
75
+
72
76
  #
73
77
  # Performance cops are opt in, and `Enabled: true` is always required.
74
78
  # Full list is here: https://github.com/rubocop-hq/rubocop-performance/tree/master/lib/rubocop/cop/performance
@@ -3,12 +3,6 @@ dist: trusty
3
3
  services:
4
4
  - redis-server
5
5
  language: ruby
6
- # Broken bundler on travis CI - https://github.com/bundler/bundler/issues/2784
7
- before_install:
8
- - gem update --system 2.7.7
9
- - gem --version
10
- - gem install bundler -v 1.6.1
11
- - bundle --version
12
6
 
13
7
  rvm:
14
8
  - 1.9.3
@@ -18,8 +12,8 @@ rvm:
18
12
  - 2.3.8
19
13
  - 2.4.5
20
14
  - 2.5.3
21
- - 2.6.0
22
- - 2.6.3
15
+ - 2.6.5
16
+ - 2.7.0
23
17
  - rbx
24
18
  # Travis's own rvm installer is failing on JRuby builds, TODO: reenable when fixed.
25
19
  # - jruby-9.1.9.0
@@ -73,9 +67,6 @@ matrix:
73
67
  allow_failures:
74
68
  - rvm: ruby-head
75
69
  - rvm: jruby-head
76
- # Ruby 2.6.x is still being eveluated and may have test failures
77
- - rvm: 2.6.0
78
- - rvm: 2.6.3
79
70
  # oraclejdk9 has a dependency issue that needs to be investigated
80
71
  - jdk: oraclejdk9
81
72
 
@@ -124,17 +115,17 @@ matrix:
124
115
  jdk: oraclejdk8
125
116
  - rvm: 2.5.3
126
117
  jdk: oraclejdk9
127
- - rvm: 2.6.0
118
+ - rvm: 2.6.5
128
119
  jdk: openjdk8
129
- - rvm: 2.6.0
120
+ - rvm: 2.6.5
130
121
  jdk: oraclejdk8
131
- - rvm: 2.6.0
122
+ - rvm: 2.6.5
132
123
  jdk: oraclejdk9
133
- - rvm: 2.6.3
124
+ - rvm: 2.7.0
134
125
  jdk: openjdk8
135
- - rvm: 2.6.3
126
+ - rvm: 2.7.0
136
127
  jdk: oraclejdk8
137
- - rvm: 2.6.3
128
+ - rvm: 2.7.0
138
129
  jdk: oraclejdk9
139
130
 
140
131
  - rvm: ruby-head
@@ -225,30 +216,39 @@ matrix:
225
216
  gemfile: gemfiles/rails40.gemfile
226
217
  - rvm: 2.5.3
227
218
  gemfile: gemfiles/rails41.gemfile
228
- - rvm: 2.6.0
219
+ - rvm: 2.6.5
229
220
  gemfile: gemfiles/rails30.gemfile
230
- - rvm: 2.6.0
221
+ - rvm: 2.6.5
231
222
  gemfile: gemfiles/rails31.gemfile
232
- - rvm: 2.6.0
223
+ - rvm: 2.6.5
233
224
  gemfile: gemfiles/rails32.gemfile
234
- - rvm: 2.6.0
225
+ - rvm: 2.6.5
235
226
  gemfile: gemfiles/rails40.gemfile
236
- - rvm: 2.6.0
227
+ - rvm: 2.6.5
237
228
  gemfile: gemfiles/rails41.gemfile
238
- - rvm: 2.6.0
229
+ - rvm: 2.6.5
239
230
  gemfile: gemfiles/rails42.gemfile
240
- - rvm: 2.6.3
231
+ # Rails 6.x tries to be compatible with Ruby 2.7, though
232
+ # it still throws a lot of warnings. No point testing earlier
233
+ # Rails with Ruby 2.7.
234
+ - rvm: 2.7.0
241
235
  gemfile: gemfiles/rails30.gemfile
242
- - rvm: 2.6.3
236
+ - rvm: 2.7.0
243
237
  gemfile: gemfiles/rails31.gemfile
244
- - rvm: 2.6.3
238
+ - rvm: 2.7.0
245
239
  gemfile: gemfiles/rails32.gemfile
246
- - rvm: 2.6.3
240
+ - rvm: 2.7.0
247
241
  gemfile: gemfiles/rails40.gemfile
248
- - rvm: 2.6.3
242
+ - rvm: 2.7.0
249
243
  gemfile: gemfiles/rails41.gemfile
250
- - rvm: 2.6.3
244
+ - rvm: 2.7.0
251
245
  gemfile: gemfiles/rails42.gemfile
246
+ - rvm: 2.7.0
247
+ gemfile: gemfiles/rails50.gemfile
248
+ - rvm: 2.7.0
249
+ gemfile: gemfiles/rails51.gemfile
250
+ - rvm: 2.7.0
251
+ gemfile: gemfiles/rails52.gemfile
252
252
  # JRuby JDBC Adapter is only compatible with Rails >= 5.x
253
253
  - rvm: jruby-9.1.9.0
254
254
  gemfile: gemfiles/rails30.gemfile
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Rollbar-gem
2
- [![Build Status](https://api.travis-ci.org/rollbar/rollbar-gem.svg?branch=master)](https://travis-ci.org/rollbar/rollbar-gem/branches)
2
+ [![Build Status](https://travis-ci.org/rollbar/rollbar-gem.svg?branch=master)](https://travis-ci.org/rollbar/rollbar-gem/branches)
3
3
  [![Gem Version](https://badge.fury.io/rb/rollbar.svg)](http://badge.fury.io/rb/rollbar)
4
4
  [![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=rollbar&package-manager=bundler&version-scheme=semver&target-version=latest)](https://dependabot.com/compatibility-score.html?dependency-name=rollbar&package-manager=bundler&version-scheme=semver&new-version=latest)
5
5
 
@@ -1 +1 @@
1
- !function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){var n=o(1),t=o(4);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.12.3/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){var n=o(2);function t(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var a=0;function l(r,e){this.options=r,this._rollbarOldOnError=null;var o=a++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var i=o(3),s=function(r,e){return new l(r,e)},d=function(r){return new i(s,r)};function c(r){return t(function(){var e=Array.prototype.slice.call(arguments,0),o={shim:this,method:r,args:e,ts:new Date};window._rollbarShims[this.shimId()].messages.push(o)})}l.prototype.loadFull=function(r,e,o,n,a){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=t(function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,t,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(t=n.args||[],i=0;i<t.length;++i)if("function"==typeof(l=t[i])){l(e);break}}"function"==typeof a&&a(e)}()}}),d.insertBefore(i,s)},l.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var p="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),u=0;u<p.length;++u)l.prototype[p[u]]=c(p[u]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var a=new d(e);return t(function(){e.captureUncaught&&(a._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,a,!0),e.wrapGlobalEventHandlers&&n.wrapGlobals(r,a,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,a,!0);var t=e.autoInstrument;return!1!==e.enabled&&(void 0===t||!0===t||"object"==typeof t&&t.network)&&r.addEventListener&&(r.addEventListener("load",a.captureLoad.bind(a)),r.addEventListener("DOMContentLoaded",a.captureDomContentLoaded.bind(a))),r[o]=a,a})()}},Rollbar:d}},function(r,e){function o(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var n;if("function"==typeof e._rollbarOldOnError)n=e._rollbarOldOnError;else if(r.onerror){for(n=r.onerror;n._rollbarOldOnError;)n=n._rollbarOldOnError;e._rollbarOldOnError=n}e.handleAnonymousErrors();var t=function(){var o=Array.prototype.slice.call(arguments,0);!function(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null);var t=e.handleUncaughtException.apply(e,n);o&&o.apply(r,n),"anonymous"===t&&(e.anonymousErrorsPending+=1)}(r,e,n,o)};o&&(t._rollbarOldOnError=n),r.onerror=t}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}},wrapGlobals:function(r,e,n){if(r){var t,a,l="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<l.length;++t)r[a=l[t]]&&r[a].prototype&&o(e,r[a].prototype,n)}}}},function(r,e){function o(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(o.prototype)}o.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=o},function(r,e){r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
1
+ !function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){"use strict";var n=o(1),t=o(4);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdn.rollbar.com/rollbarjs/refs/tags/v2.15.2/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){"use strict";var n=o(2);function t(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var a=0;function l(r,e){this.options=r,this._rollbarOldOnError=null;var o=a++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var i=o(3),s=function(r,e){return new l(r,e)},d=function(r){return new i(s,r)};function c(r){return t((function(){var e=this,o=Array.prototype.slice.call(arguments,0),n={shim:e,method:r,args:o,ts:new Date};window._rollbarShims[this.shimId()].messages.push(n)}))}l.prototype.loadFull=function(r,e,o,n,a){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=t((function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,t,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(t=n.args||[],i=0;i<t.length;++i)if("function"==typeof(l=t[i])){l(e);break}}"function"==typeof a&&a(e)}()}})),d.insertBefore(i,s)},l.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var u="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),p=0;p<u.length;++p)l.prototype[u[p]]=c(u[p]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var a=new d(e);return t((function(){e.captureUncaught&&(a._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,a,!0),e.wrapGlobalEventHandlers&&n.wrapGlobals(r,a,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,a,!0);var t=e.autoInstrument;return!1!==e.enabled&&(void 0===t||!0===t||"object"==typeof t&&t.network)&&r.addEventListener&&(r.addEventListener("load",a.captureLoad.bind(a)),r.addEventListener("DOMContentLoaded",a.captureDomContentLoaded.bind(a))),r[o]=a,a}))()}},Rollbar:d}},function(r,e,o){"use strict";function n(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null);var t=e.handleUncaughtException.apply(e,n);o&&o.apply(r,n),"anonymous"===t&&(e.anonymousErrorsPending+=1)}function t(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var t;if("function"==typeof e._rollbarOldOnError)t=e._rollbarOldOnError;else if(r.onerror){for(t=r.onerror;t._rollbarOldOnError;)t=t._rollbarOldOnError;e._rollbarOldOnError=t}e.handleAnonymousErrors();var a=function(){var o=Array.prototype.slice.call(arguments,0);n(r,e,t,o)};o&&(a._rollbarOldOnError=t),r.onerror=a}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}},wrapGlobals:function(r,e,o){if(r){var n,a,l="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(n=0;n<l.length;++n)r[a=l[n]]&&r[a].prototype&&t(e,r[a].prototype,o)}}}},function(r,e,o){"use strict";function n(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(n.prototype)}n.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=n},function(r,e,o){"use strict";r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
@@ -129,6 +129,7 @@ An array of backup handlers if the async handlers fails. Each should respond to
129
129
 
130
130
  For use with `write_to_file`. Indicates location of the rollbar log file being
131
131
  tracked by [rollbar-agent](https://github.com/rollbar/rollbar-agent).
132
+ Enable `files_with_pid_name_enabled` if you want to have different files for each process(only works if extension `rollbar`)
132
133
 
133
134
  ### framework
134
135
 
@@ -44,8 +44,12 @@ elsif RUBY_VERSION.start_with?('2')
44
44
  gem 'simplecov'
45
45
  end
46
46
 
47
- # We need last sinatra that uses rack 2.x
48
- 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'
49
53
  gem 'database_cleaner'
50
54
  gem 'delayed_job', :require => false
51
55
  gem 'generator_spec'
@@ -44,8 +44,12 @@ elsif RUBY_VERSION.start_with?('2')
44
44
  gem 'simplecov'
45
45
  end
46
46
 
47
- # We need last sinatra that uses rack 2.x
48
- 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'
49
53
 
50
54
  gem 'database_cleaner'
51
55
  gem 'delayed_job', :require => false
@@ -15,7 +15,7 @@ is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_
15
15
  gem 'appraisal'
16
16
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
17
17
  gem 'jruby-openssl', :platform => :jruby
18
- gem 'rails', '6.0.0.rc1'
18
+ gem 'rails', '6.0.2.1'
19
19
  gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw]
20
20
 
21
21
  gem 'rspec-core', '~> 3.8.0'
@@ -39,7 +39,7 @@ module Rails
39
39
  end
40
40
 
41
41
  def eval_runner
42
- if Rails.version >= '5.1.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,6 +55,8 @@ 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
 
@@ -24,7 +24,6 @@ module Rollbar
24
24
  attr_accessor :environment
25
25
  attr_accessor :exception_level_filters
26
26
  attr_accessor :failover_handlers
27
- attr_accessor :filepath
28
27
  attr_accessor :framework
29
28
  attr_accessor :ignored_person_ids
30
29
  attr_accessor :host
@@ -61,7 +60,6 @@ module Rollbar
61
60
  attr_accessor :async_json_payload
62
61
  attr_reader :use_eventmachine
63
62
  attr_accessor :web_base
64
- attr_accessor :write_to_file
65
63
  attr_reader :send_extra_frame_data
66
64
  attr_accessor :use_exception_level_filters_default
67
65
  attr_accessor :proxy
@@ -70,6 +68,13 @@ module Rollbar
70
68
  attr_accessor :log_payload
71
69
  attr_accessor :backtrace_cleaner
72
70
 
71
+ attr_accessor :write_to_file
72
+ attr_accessor :filepath
73
+ attr_accessor :files_with_pid_name_enabled
74
+ attr_accessor :files_processed_enabled
75
+ attr_accessor :files_processed_duration # seconds
76
+ attr_accessor :files_processed_size # bytes
77
+
73
78
  attr_reader :project_gem_paths
74
79
  attr_accessor :configured_options
75
80
 
@@ -134,7 +139,6 @@ module Rollbar
134
139
  @use_eventmachine = false
135
140
  @verify_ssl_peer = true
136
141
  @web_base = DEFAULT_WEB_BASE
137
- @write_to_file = false
138
142
  @send_extra_frame_data = :none
139
143
  @project_gem_paths = []
140
144
  @use_exception_level_filters_default = false
@@ -150,6 +154,12 @@ module Rollbar
150
154
  :on_report_internal_error => nil # params: exception
151
155
  }
152
156
 
157
+ @write_to_file = false
158
+ @files_with_pid_name_enabled = false
159
+ @files_processed_enabled = false
160
+ @files_processed_duration = 60
161
+ @files_processed_size = 5 * 1000 * 1000
162
+
153
163
  @configured_options = ConfiguredOptions.new(self)
154
164
  end
155
165
 
@@ -1,3 +1,5 @@
1
+ require 'json'
2
+
1
3
  module Rollbar
2
4
  # Deploy Tracking API wrapper module
3
5
  module Deploy
@@ -3,7 +3,6 @@ module Rollbar
3
3
  class Encoder
4
4
  ALL_ENCODINGS = [::Encoding::UTF_8, ::Encoding::ISO_8859_1, ::Encoding::ASCII_8BIT, ::Encoding::US_ASCII].freeze
5
5
  ASCII_ENCODINGS = [::Encoding::US_ASCII, ::Encoding::ASCII_8BIT, ::Encoding::ISO_8859_1].freeze
6
- ENCODING_OPTIONS = { :invalid => :replace, :undef => :replace, :replace => '' }.freeze
7
6
  UTF8 = 'UTF-8'.freeze
8
7
  BINARY = 'binary'.freeze
9
8
 
@@ -21,10 +20,19 @@ module Rollbar
21
20
  encoded_value = if encoding == ::Encoding::UTF_8 && value.valid_encoding?
22
21
  value
23
22
  else
24
- force_encoding(value).encode(*encoding_args(value))
23
+ force_encoding(value).encode(
24
+ *encoding_args(value),
25
+ # Ruby 2.7 requires this to look like keyword args,
26
+ # and Ruby 1.9.3 doesn't understand keyword args, so
27
+ # don't use hash rockets here and both will be happy.
28
+ invalid: :replace, undef: :replace, replace: '' # rubocop:disable Style/HashSyntax
29
+ )
25
30
  end
26
31
 
27
32
  object.is_a?(Symbol) ? encoded_value.to_sym : encoded_value
33
+ rescue StandardError => e
34
+ # If encoding fails for any reason, replace the string with a diagnostic error.
35
+ "error encoding string: #{e.class}: #{e.message}"
28
36
  end
29
37
 
30
38
  private
@@ -54,7 +62,6 @@ module Rollbar
54
62
  def encoding_args(value)
55
63
  args = [UTF8]
56
64
  args << BINARY if ASCII_ENCODINGS.include?(value.encoding)
57
- args << ENCODING_OPTIONS
58
65
 
59
66
  args
60
67
  end
@@ -65,7 +65,6 @@ module Rollbar
65
65
  def build
66
66
  data = build_data
67
67
  self.payload = {
68
- 'access_token' => configuration.access_token,
69
68
  'data' => data
70
69
  }
71
70
 
@@ -1,4 +1,5 @@
1
1
  require 'rollbar/language_support'
2
+ require 'json'
2
3
 
3
4
  module Rollbar
4
5
  module JSON # :nodoc:
@@ -83,7 +83,12 @@ module Rollbar
83
83
  response = ::Rack::Response.new(response_string, app_result[0],
84
84
  app_result[1])
85
85
 
86
- response.finish
86
+ finished = response.finish
87
+
88
+ # Rack < 2.x Response#finish returns self in array[2]. Rack >= 2.x returns self.body.
89
+ # Always return with the response object here regardless of rack version.
90
+ finished[2] = response
91
+ finished
87
92
  end
88
93
 
89
94
  def build_body_with_js(env, body, head_open_end)
@@ -116,6 +121,8 @@ module Rollbar
116
121
  end
117
122
 
118
123
  def config_js_tag(env)
124
+ require 'json'
125
+
119
126
  js_config = Rollbar::Util.deep_copy(config[:options])
120
127
 
121
128
  add_person_data(js_config, env)
@@ -19,7 +19,8 @@ module Rollbar
19
19
  attr_accessor :last_report
20
20
  attr_accessor :scope_object
21
21
 
22
- @file_semaphore = Mutex.new
22
+ MUTEX = Mutex.new
23
+ EXTENSION_REGEXP = /.rollbar\z/.freeze
23
24
 
24
25
  def initialize(parent_notifier = nil, payload_options = nil, scope = nil)
25
26
  if parent_notifier
@@ -103,10 +104,10 @@ module Rollbar
103
104
 
104
105
  # Sends a report to Rollbar.
105
106
  #
106
- # Accepts any number of arguments. The last String argument will become
107
- # the message or description of the report. The last Exception argument
108
- # will become the associated exception for the report. The last hash
109
- # argument will be used as the extra data for the report.
107
+ # Accepts a level string plus any number of arguments. The last String
108
+ # argument will become the message or description of the report. The last
109
+ # Exception argument will become the associated exception for the report.
110
+ # The last hash argument will be used as the extra data for the report.
110
111
  #
111
112
  # If the extra hash contains a symbol key :custom_data_method_context
112
113
  # the value of the key will be used as the context for
@@ -117,14 +118,14 @@ module Rollbar
117
118
  # begin
118
119
  # foo = bar
119
120
  # rescue => e
120
- # Rollbar.log(e)
121
+ # Rollbar.log('error', e)
121
122
  # end
122
123
  #
123
124
  # @example
124
- # Rollbar.log('This is a simple log message')
125
+ # Rollbar.log('info', 'This is a simple log message')
125
126
  #
126
127
  # @example
127
- # Rollbar.log(e, 'This is a description of the exception')
128
+ # Rollbar.log('error', e, 'This is a description of the exception')
128
129
  #
129
130
  def log(level, *args)
130
131
  return 'disabled' unless enabled?
@@ -200,11 +201,11 @@ module Rollbar
200
201
  def process_item(item)
201
202
  if configuration.write_to_file
202
203
  if configuration.use_async
203
- @file_semaphore.synchronize do
204
- write_item(item)
204
+ MUTEX.synchronize do
205
+ do_write_item(item)
205
206
  end
206
207
  else
207
- write_item(item)
208
+ do_write_item(item)
208
209
  end
209
210
  else
210
211
  send_item(item)
@@ -285,11 +286,10 @@ module Rollbar
285
286
  :orig_host => host
286
287
  },
287
288
  :internal => true,
288
- :failsafe => true
289
+ 'failsafe' => true
289
290
  }
290
291
 
291
292
  failsafe_payload = {
292
- 'access_token' => configuration.access_token,
293
293
  'data' => failsafe_data
294
294
  }
295
295
 
@@ -675,27 +675,24 @@ module Rollbar
675
675
  end
676
676
  end
677
677
 
678
- def write_item(item)
679
- if configuration.use_async
680
- @file_semaphore.synchronize do
681
- do_write_item(item)
682
- end
683
- else
684
- do_write_item(item)
685
- end
686
- end
687
-
688
678
  def do_write_item(item)
689
679
  log_info '[Rollbar] Writing item to file'
690
680
 
691
681
  body = item.dump
692
682
  return unless body
693
683
 
684
+ file_name = if configuration.files_with_pid_name_enabled
685
+ configuration.filepath.gsub(EXTENSION_REGEXP, "_#{Process.pid}\\0")
686
+ else
687
+ configuration.filepath
688
+ end
689
+
694
690
  begin
695
- @file ||= File.open(configuration.filepath, 'a')
691
+ @file ||= File.open(file_name, 'a')
696
692
 
697
693
  @file.puts(body)
698
694
  @file.flush
695
+ update_file(@file, file_name)
699
696
 
700
697
  log_info '[Rollbar] Success'
701
698
  rescue IOError => e
@@ -703,6 +700,18 @@ module Rollbar
703
700
  end
704
701
  end
705
702
 
703
+ def update_file(file, file_name)
704
+ return unless configuration.files_processed_enabled
705
+
706
+ time_now = Time.now
707
+ return if configuration.files_processed_duration > time_now - file.birthtime && file.size < configuration.files_processed_size
708
+
709
+ new_file_name = file_name.gsub(EXTENSION_REGEXP, "_processed_#{time_now.to_i}\\0")
710
+ File.rename(file, new_file_name)
711
+ file.close
712
+ @file = File.open(file_name, 'a')
713
+ end
714
+
706
715
  def failsafe_reason(message, exception)
707
716
  body = ''
708
717
 
@@ -794,7 +803,7 @@ module Rollbar
794
803
  end
795
804
 
796
805
  def via_failsafe?(item)
797
- item.payload.fetch('data', {}).fetch(:failsafe, false)
806
+ item.payload.fetch('data', {}).fetch('failsafe', false)
798
807
  end
799
808
  end
800
809
  end
@@ -14,7 +14,9 @@ module Rollbar
14
14
  end
15
15
  end
16
16
 
17
- ActiveSupport.on_load(:action_mailer) do
18
- # Automatically add to ActionMailer::DeliveryJob
19
- ActionMailer::DeliveryJob.send(:include, Rollbar::ActiveJob) if defined?(ActionMailer::DeliveryJob)
17
+ if defined?(ActiveSupport) && ActiveSupport.respond_to?(:on_load)
18
+ ActiveSupport.on_load(:action_mailer) do
19
+ # Automatically add to ActionMailer::DeliveryJob
20
+ ActionMailer::DeliveryJob.send(:include, Rollbar::ActiveJob) if defined?(ActionMailer::DeliveryJob)
21
+ end
20
22
  end
@@ -12,7 +12,13 @@ module Rollbar
12
12
  lifecycle.around(:invoke_job, &Delayed.invoke_job_callback)
13
13
  lifecycle.after(:failure) do |_, job, _, _|
14
14
  data = Rollbar::Delayed.build_job_data(job)
15
- ::Rollbar.scope(:request => data).error("Job has failed and won't be retried anymore: " + job.last_error, :use_exception_level_filters => true) if job.last_error
15
+
16
+ # DelayedJob < 4.1 doesn't provide job#error
17
+ if job.class.method_defined? :error
18
+ ::Rollbar.scope(:request => data).error(job.error, :use_exception_level_filters => true) if job.error
19
+ elsif job.last_error
20
+ ::Rollbar.scope(:request => data).error("Job has failed and won't be retried anymore: " + job.last_error, :use_exception_level_filters => true)
21
+ end
16
22
  end
17
23
  end
18
24
  end
@@ -247,7 +247,12 @@ module Rollbar
247
247
  end
248
248
 
249
249
  def sensitive_headers_list
250
- Rollbar.configuration.scrub_headers || []
250
+ return [] unless Rollbar.configuration.scrub_headers && Rollbar.configuration.scrub_headers.is_a?(Array)
251
+
252
+ # Normalize into the expected matching format
253
+ Rollbar.configuration.scrub_headers.map do |header|
254
+ header.split(/[-_]/).map(&:capitalize).join('-').gsub(/^Http-/, '')
255
+ end
251
256
  end
252
257
  end
253
258
  end
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = '2.23.0'.freeze
2
+ VERSION = '2.25.1'.freeze
3
3
  end
@@ -13,6 +13,7 @@ Gem::Specification.new do |gem|
13
13
  gem.homepage = 'https://rollbar.com'
14
14
  gem.license = 'MIT'
15
15
  gem.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
+ gem.files += ['spec/support/rollbar_api.rb'] # useful helper for app spec/tests.
16
17
  gem.name = 'rollbar'
17
18
  gem.require_paths = ['lib']
18
19
  gem.required_ruby_version = '>= 1.9.3'
@@ -0,0 +1,67 @@
1
+ require 'rack/request'
2
+
3
+ class RollbarAPI
4
+ UNAUTHORIZED_ACCESS_TOKEN = 'unauthorized'.freeze
5
+
6
+ def call(env)
7
+ request = Rack::Request.new(env)
8
+ json = JSON.parse(request.body.read)
9
+
10
+ return unauthorized unless authorized?(json, request)
11
+
12
+ return bad_request(json) unless valid_data?(json, request)
13
+
14
+ success(json, request)
15
+ end
16
+
17
+ protected
18
+
19
+ def authorized?(_json, request)
20
+ request.env['HTTP_X_ROLLBAR_ACCESS_TOKEN'] != UNAUTHORIZED_ACCESS_TOKEN
21
+ end
22
+
23
+ def response_headers
24
+ {
25
+ 'Content-Type' => 'application/json'
26
+ }
27
+ end
28
+
29
+ def valid_data?(_json, request)
30
+ !!request.env['HTTP_X_ROLLBAR_ACCESS_TOKEN']
31
+ end
32
+
33
+ def unauthorized
34
+ [401, response_headers, [unauthorized_body]]
35
+ end
36
+
37
+ def bad_request(_json)
38
+ [400, response_headers, [bad_request_body]]
39
+ end
40
+
41
+ def success(json, request)
42
+ [200, response_headers, [success_body(json, request)]]
43
+ end
44
+
45
+ def unauthorized_body
46
+ result(1, nil, 'invalid access token')
47
+ end
48
+
49
+ def bad_request_body
50
+ result(1, nil, 'bad request')
51
+ end
52
+
53
+ def success_body(json, _request)
54
+ result(0, {
55
+ :id => rand(1_000_000),
56
+ :uuid => json['data']['uuid']
57
+ }, nil)
58
+ end
59
+
60
+ def result(err, body, message)
61
+ {
62
+ :err => err,
63
+ :result => body,
64
+ :message => message
65
+ }.to_json
66
+ end
67
+ end
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.23.0
4
+ version: 2.25.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: 2019-12-19 00:00:00.000000000 Z
11
+ date: 2020-06-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Easy and powerful exception tracking for Ruby
14
14
  email:
@@ -134,6 +134,7 @@ files:
134
134
  - lib/tasks/benchmark.rake
135
135
  - lib/tasks/tasks.rake
136
136
  - rollbar.gemspec
137
+ - spec/support/rollbar_api.rb
137
138
  homepage: https://rollbar.com
138
139
  licenses:
139
140
  - MIT