rollbar 2.26.0 → 3.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69307fc6496e1b12a3ebbe3e40b7341f725a7f4efadd6a1a5e76d7246bc86928
4
- data.tar.gz: 117fb5d03ab1f140f9469558c6560963180806935d3d56eeeb35da9cf450edc6
3
+ metadata.gz: d8602aedfaab8e609560a1869d54f8ec2c2b95a8e7465eff3cff78084d431c7f
4
+ data.tar.gz: 6ca1099d0f5447551ebcfbdeaa7e9d918bbc898851c56d9cee4f4aad1be20d96
5
5
  SHA512:
6
- metadata.gz: 61587004c5ba54fffb2bd34d9f4abdfd182a82002ebcbe688c8c500975797f43f2caac63ce3ca510276828e1b2132cda95027b42ea02533221a18a008d8d654b
7
- data.tar.gz: 9b62efc68f689811910cb92ae3262447c41732eaa6ebdc14019b7fd96114fcfebddf921e29699480e1fa7a21d54281e9130e99a3c85f8104f2d4440fd22f840d
6
+ metadata.gz: 844fa4a5ce4465edca84afc734a757f11274ea795ff8cca20b748f59e385dd5e3680da913418e49a46d3a344ac3b4583c381cc2f5c5ba4fa4fbea0d979cd3d70
7
+ data.tar.gz: 5fdd265cc302be7c79d5d5c05a9ff2f724a0b18387c2a58ca11d6c25d02a44543be43e3aea8038efc2b378e39f7d6c73a961530245119ce37cde181757e63934
@@ -0,0 +1,25 @@
1
+ ## Description of the change
2
+
3
+ > Description here
4
+ ## Type of change
5
+ - [ ] Bug fix (non-breaking change that fixes an issue)
6
+ - [ ] New feature (non-breaking change that adds functionality)
7
+ - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
8
+
9
+ ## Related issues
10
+
11
+ > Fix [#1]()
12
+ ## Checklists
13
+
14
+ ### Development
15
+
16
+ - [ ] Lint rules pass locally
17
+ - [ ] The code changed/added as part of this pull request has been covered with tests
18
+ - [ ] All tests related to the changed code pass in development
19
+
20
+ ### Code review
21
+
22
+ - [ ] This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
23
+ - [ ] "Ready for review" label attached to the PR and reviewers mentioned in a comment
24
+ - [ ] Changes have been reviewed by at least one other engineer
25
+ - [ ] Issue from task tracker has a link to this pull request
@@ -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/MethodParameterName:
54
+ Naming/UncommunicativeMethodParamName:
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.
@@ -5,7 +5,6 @@ services:
5
5
  language: ruby
6
6
 
7
7
  rvm:
8
- - 1.9.3
9
8
  - 2.0.0
10
9
  - 2.1.0
11
10
  - 2.2.2
@@ -73,12 +72,6 @@ matrix:
73
72
  exclude:
74
73
  # Don't run tests for non-jruby environments with the JDK.
75
74
  # NOTE: openjdk7 is missing from these exclusions so that Travis will run at least 1 build for the given rvm.
76
- - rvm: 1.9.3
77
- jdk: openjdk8
78
- - rvm: 1.9.3
79
- jdk: oraclejdk8
80
- - rvm: 1.9.3
81
- jdk: oraclejdk9
82
75
  - rvm: 2.0.0
83
76
  jdk: openjdk8
84
77
  - rvm: 2.0.0
@@ -149,15 +142,6 @@ matrix:
149
142
  - rvm: 2.4.5
150
143
  gemfile: gemfiles/rails60.gemfile
151
144
  # Rails 5.x requires Ruby 2.2.2 or higher
152
- - rvm: 1.9.3
153
- gemfile: gemfiles/rails50.gemfile
154
- - rvm: 1.9.3
155
- gemfile: gemfiles/rails51.gemfile
156
- - rvm: 1.9.3
157
- gemfile: gemfiles/rails52.gemfile
158
- - rvm: 1.9.3
159
- gemfile: gemfiles/rails60.gemfile
160
- # Rails 5.x requires Ruby 2.2.2 or higher
161
145
  - rvm: 2.0.0
162
146
  gemfile: gemfiles/rails50.gemfile
163
147
  - rvm: 2.0.0
data/Gemfile CHANGED
@@ -44,18 +44,11 @@ platforms :rbx do
44
44
  gem 'rubysl', '~> 2.0' unless RUBY_VERSION.start_with?('1')
45
45
  end
46
46
 
47
- if RUBY_VERSION.start_with?('1.9')
48
- gem 'capistrano', '<= 3.4.1', :require => false
49
- gem 'json', '1.8.6'
50
- gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
51
- gem 'sucker_punch', '~> 1.0'
52
- elsif RUBY_VERSION.start_with?('2')
53
- gem 'capistrano', :require => false # rubocop:disable Bundler/DuplicatedGem
54
- gem 'codacy-coverage'
55
- gem 'shoryuken' # rubocop:disable Bundler/DuplicatedGem
56
- gem 'simplecov'
57
- gem 'sucker_punch', '~> 2.0' # rubocop:disable Bundler/DuplicatedGem
58
- end
47
+ gem 'capistrano', :require => false
48
+ gem 'codacy-coverage'
49
+ gem 'shoryuken'
50
+ gem 'simplecov'
51
+ gem 'sucker_punch', '~> 2.0'
59
52
 
60
53
  unless is_jruby
61
54
  # JRuby doesn't support fork, which is required for this test helper.
data/README.md CHANGED
@@ -4,14 +4,6 @@
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
 
6
6
 
7
- > WARNING: Ruby 2.6.0 introduced a new bug bug ([#15472 -
8
- Invalid JSON data being sent from Net::HTTP in some cases with Ruby 2.6.0](https://bugs.ruby-lang.org/issues/15472)) that may result in the Rollbar API returning an error when an exception is reported. (See [rollbar-gem issue #797](https://github.com/rollbar/rollbar-gem/issues/797)).
9
-
10
- > UPDATE: This bug is fixed in Ruby 2.6.1, and rollbar-gem has a safe workaround in version >= 2.19.0.
11
- If you need to stay on Ruby 2.6.0 for any reason, make sure you have the latest rollbar-gem.
12
-
13
-
14
-
15
7
  [Rollbar](https://rollbar.com) is a real-time exception reporting 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.
16
8
 
17
9
  Rollbar-gem is the SDK for Ruby apps and includes support for apps using Rails, Sinatra, Rack, plain Ruby, and other frameworks.
@@ -27,10 +19,20 @@ For complete usage instructions and configuration reference, see our [Ruby SDK d
27
19
 
28
20
  ## Compatibility
29
21
 
22
+ Version >= 3.0.0 is compatible with Ruby >= 2.0.0.
23
+
30
24
  Version >= 2.19.0 is compatible with Ruby >= 1.9.3.
31
25
 
32
26
  Version < 2.19.0 is compatible with Ruby >= 1.8.7.
33
27
 
28
+ ### Ruby 2.6.0
29
+
30
+ > WARNING: Ruby 2.6.0 introduced a new bug bug ([#15472 -
31
+ Invalid JSON data being sent from Net::HTTP in some cases with Ruby 2.6.0](https://bugs.ruby-lang.org/issues/15472)) that may result in the Rollbar API returning an error when an exception is reported. (See [rollbar-gem issue #797](https://github.com/rollbar/rollbar-gem/issues/797)).
32
+
33
+ > UPDATE: This bug is fixed in Ruby 2.6.1, and rollbar-gem has a safe workaround in version >= 2.19.0.
34
+ If you need to stay on Ruby 2.6.0 for any reason, make sure you have the latest rollbar-gem.
35
+
34
36
  ## Release History & Changelog
35
37
 
36
38
  See our [Releases](https://github.com/rollbar/rollbar-gem/releases) page for a list of all releases, including changes.
@@ -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){"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}}}}]);
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(5);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdn.rollbar.com/rollbarjs/refs/tags/v2.19.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){"use strict";var n=o(2),t=o(3);function a(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var l=0;function i(r,e){this.options=r,this._rollbarOldOnError=null;var o=l++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var s=o(4),d=function(r,e){return new i(r,e)},c=function(r){return new s(d,r)};function u(r){return a((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)}))}i.prototype.loadFull=function(r,e,o,n,t){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=a((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,a,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(a=n.args||[],i=0;i<a.length;++i)if("function"==typeof(l=a[i])){l(e);break}}"function"==typeof t&&t(e)}()}})),d.insertBefore(i,s)},i.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(","),f=0;f<p.length;++f)i.prototype[p[f]]=u(p[f]);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 l=new c(e);return a((function(){e.captureUncaught&&(l._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,l,!0),e.wrapGlobalEventHandlers&&t(r,l,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,l,!0);var a=e.autoInstrument;return!1!==e.enabled&&(void 0===a||!0===a||"object"==typeof a&&a.network)&&r.addEventListener&&(r.addEventListener("load",l.captureLoad.bind(l)),r.addEventListener("DOMContentLoaded",l.captureDomContentLoaded.bind(l))),r[o]=l,l}))()}},Rollbar:c}},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)}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)}}}},function(r,e,o){"use strict";function n(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=function(r,e,o){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&&n(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}}}}]);
@@ -108,6 +108,13 @@ Rollbar notifier.
108
108
 
109
109
  The number of job failures before reporting the failure to Rollbar.
110
110
 
111
+ ### async_skip_report_handler
112
+
113
+ **Default** `nil`
114
+ **Example** `-> (job) { job.cron? }`
115
+
116
+ A handler, should respond to `#call`, receives the job and returns a boolean. If true, reporting errors will be skipped. If provided, dj_threshold isn't checked.
117
+
111
118
  ### enabled
112
119
 
113
120
  **Default** `true`
@@ -34,17 +34,11 @@ platforms :rbx do
34
34
  gem 'rubysl-test-unit'
35
35
  end
36
36
 
37
- if RUBY_VERSION.start_with?('1.9')
38
- gem 'capistrano', '<= 3.4.1', :require => false
39
- gem 'sucker_punch', '~> 1.0'
40
- gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
41
- elsif RUBY_VERSION.start_with?('2')
42
- gem 'capistrano', :require => false
43
- gem 'sucker_punch', '~> 2.0'
44
- gem 'shoryuken'
45
- gem 'codacy-coverage'
46
- gem 'simplecov'
47
- end
37
+ gem 'capistrano', :require => false
38
+ gem 'sucker_punch', '~> 2.0'
39
+ gem 'shoryuken'
40
+ gem 'codacy-coverage'
41
+ gem 'simplecov'
48
42
 
49
43
  gem 'sinatra'
50
44
  gem 'delayed_job', :require => false
@@ -54,13 +48,7 @@ gem 'genspec', '>= 0.2.8'
54
48
  gem 'girl_friday', '>= 0.11.1'
55
49
  gem 'rspec-command'
56
50
 
57
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
58
- gem 'public_suffix', '< 1.5'
59
- gem 'mime-types', '< 3.0'
60
- gem 'webmock', '< 2.3.0', :require => false
61
- else
62
- gem 'webmock', :require => false
63
- end
51
+ gem 'webmock', :require => false
64
52
 
65
53
  gem 'resque', '< 2.0.0'
66
54
  gem 'aws-sdk-sqs'
@@ -33,17 +33,11 @@ platforms :rbx do
33
33
  gem 'rubysl-test-unit'
34
34
  end
35
35
 
36
- if RUBY_VERSION.start_with?('1.9')
37
- gem 'capistrano', '<= 3.4.1', :require => false
38
- gem 'sucker_punch'
39
- gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
40
- elsif RUBY_VERSION.start_with?('2')
41
- gem 'capistrano', :require => false
42
- gem 'sucker_punch'
43
- gem 'shoryuken'
44
- gem 'codacy-coverage'
45
- gem 'simplecov'
46
- end
36
+ gem 'capistrano', :require => false
37
+ gem 'sucker_punch'
38
+ gem 'shoryuken'
39
+ gem 'codacy-coverage'
40
+ gem 'simplecov'
47
41
 
48
42
  gem 'sinatra'
49
43
  gem 'delayed_job', :require => false
@@ -53,13 +47,7 @@ gem 'girl_friday'
53
47
  gem 'generator_spec'
54
48
  gem 'rspec-command'
55
49
 
56
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
57
- gem 'mime-types', '< 3.0'
58
- gem 'public_suffix', '< 1.5'
59
- gem 'webmock', '< 2.3.0', :require => false
60
- else
61
- gem 'webmock', :require => false
62
- end
50
+ gem 'webmock', :require => false
63
51
 
64
52
  gem 'resque', '< 2.0.0'
65
53
  gem 'aws-sdk-sqs'
@@ -35,17 +35,11 @@ platforms :rbx do
35
35
  gem 'rubysl-test-unit'
36
36
  end
37
37
 
38
- if RUBY_VERSION.start_with?('1.9')
39
- gem 'capistrano', '<= 3.4.1', :require => false
40
- gem 'sucker_punch', '~> 1.0'
41
- gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
42
- elsif RUBY_VERSION.start_with?('2')
43
- gem 'capistrano', :require => false
44
- gem 'sucker_punch', '~> 2.0'
45
- gem 'shoryuken'
46
- gem 'codacy-coverage'
47
- gem 'simplecov'
48
- end
38
+ gem 'capistrano', :require => false
39
+ gem 'sucker_punch', '~> 2.0'
40
+ gem 'shoryuken'
41
+ gem 'codacy-coverage'
42
+ gem 'simplecov'
49
43
 
50
44
  gem 'delayed_job', :require => false
51
45
  gem 'redis'
@@ -56,13 +50,7 @@ gem 'generator_spec'
56
50
  gem 'girl_friday', '>= 0.11.1'
57
51
  gem 'rspec-command'
58
52
 
59
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
60
- gem 'mime-types', '< 3.0'
61
- gem 'public_suffix', '< 1.5'
62
- gem 'webmock', '< 2.3.0', :require => false
63
- else
64
- gem 'webmock', :require => false
65
- end
53
+ gem 'webmock', :require => false
66
54
 
67
55
  gem 'resque', '< 2.0.0'
68
56
  gem 'aws-sdk-sqs'
@@ -35,19 +35,12 @@ platforms :rbx do
35
35
  gem 'rubysl-test-unit'
36
36
  end
37
37
 
38
- if RUBY_VERSION.start_with?('1.9')
39
- gem 'capistrano', '<= 3.4.1', :require => false
40
- gem 'sucker_punch', '~> 1.0'
41
- gem 'json', '~> 1.8'
42
- gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
43
- elsif RUBY_VERSION.start_with?('2')
44
- gem 'capistrano', :require => false
45
- gem 'sucker_punch', '~> 2.0'
46
- gem 'json', '~> 2.0'
47
- gem 'shoryuken'
48
- gem 'codacy-coverage'
49
- gem 'simplecov'
50
- end
38
+ gem 'capistrano', :require => false
39
+ gem 'sucker_punch', '~> 2.0'
40
+ gem 'json', '~> 2.0'
41
+ gem 'shoryuken'
42
+ gem 'codacy-coverage'
43
+ gem 'simplecov'
51
44
 
52
45
  gem 'delayed_job', :require => false
53
46
  gem 'redis'
@@ -59,13 +52,7 @@ gem 'generator_spec'
59
52
  gem 'girl_friday', '>= 0.11.1'
60
53
  gem 'rspec-command'
61
54
 
62
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
63
- gem 'mime-types', '< 3.0'
64
- gem 'public_suffix', '< 1.5'
65
- gem 'webmock', '< 2.3.0', :require => false
66
- else
67
- gem 'webmock', :require => false
68
- end
55
+ gem 'webmock', :require => false
69
56
 
70
57
  gem 'aws-sdk-sqs'
71
58
 
@@ -32,17 +32,11 @@ platforms :rbx do
32
32
  gem 'rubysl', '~> 2.0' unless RUBY_VERSION.start_with?('1')
33
33
  end
34
34
 
35
- if RUBY_VERSION.start_with?('1.9')
36
- gem 'capistrano', '<= 3.4.1', :require => false
37
- gem 'sucker_punch', '~> 1.0'
38
- gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
39
- elsif RUBY_VERSION.start_with?('2')
40
- gem 'capistrano', :require => false
41
- gem 'sucker_punch', '~> 2.0'
42
- gem 'shoryuken'
43
- gem 'codacy-coverage'
44
- gem 'simplecov'
45
- end
35
+ gem 'capistrano', :require => false
36
+ gem 'sucker_punch', '~> 2.0'
37
+ gem 'shoryuken'
38
+ gem 'codacy-coverage'
39
+ gem 'simplecov'
46
40
 
47
41
  gem 'delayed_job', :require => false
48
42
  gem 'redis'
@@ -54,13 +48,7 @@ gem 'generator_spec'
54
48
  gem 'girl_friday', '>= 0.11.1'
55
49
  gem 'rspec-command'
56
50
 
57
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
58
- gem 'mime-types', '< 3.0'
59
- gem 'public_suffix', '< 1.5'
60
- gem 'webmock', '< 2.3.0', :require => false
61
- else
62
- gem 'webmock', :require => false
63
- end
51
+ gem 'webmock', :require => false
64
52
 
65
53
  gem 'resque'
66
54
  gem 'aws-sdk-sqs'
@@ -37,13 +37,8 @@ else
37
37
  gem 'sidekiq', '>= 2.13.0'
38
38
  end
39
39
 
40
- if RUBY_VERSION.start_with?('1.9')
41
- gem 'capistrano', '<= 3.4.1', :require => false
42
- gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
43
- elsif RUBY_VERSION.start_with?('2')
44
- gem 'capistrano', :require => false
45
- gem 'shoryuken'
46
- end
40
+ gem 'capistrano', :require => false
41
+ gem 'shoryuken'
47
42
 
48
43
  gem 'database_cleaner', '~> 1.0.0'
49
44
  gem 'delayed_job', :require => false
@@ -56,17 +51,10 @@ gem 'sinatra'
56
51
 
57
52
  gem 'nokogiri', '~> 1.6.0' if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('2.0')
58
53
 
59
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
60
- gem 'mime-types', '< 3.0'
61
- gem 'public_suffix', '< 1.5'
62
- gem 'sucker_punch', '~> 1.0'
63
- gem 'webmock', '< 2.3.0', :require => false
64
- else
65
- gem 'sucker_punch', '~> 2.0'
66
- gem 'webmock', :require => false
67
- gem 'codacy-coverage'
68
- gem 'simplecov'
69
- end
54
+ gem 'sucker_punch', '~> 2.0'
55
+ gem 'webmock', :require => false
56
+ gem 'codacy-coverage'
57
+ gem 'simplecov'
70
58
 
71
59
  gem 'aws-sdk-sqs'
72
60
 
@@ -34,15 +34,10 @@ platforms :rbx do
34
34
  gem 'rubysl', '~> 2.0' unless RUBY_VERSION.start_with?('1')
35
35
  end
36
36
 
37
- if RUBY_VERSION.start_with?('1.9')
38
- gem 'capistrano', '<= 3.4.1', :require => false
39
- gem 'sucker_punch', '~> 1.0'
40
- elsif RUBY_VERSION.start_with?('2')
41
- gem 'capistrano', :require => false
42
- gem 'sucker_punch', '~> 2.0'
43
- gem 'codacy-coverage'
44
- gem 'simplecov'
45
- end
37
+ gem 'capistrano', :require => false
38
+ gem 'sucker_punch', '~> 2.0'
39
+ gem 'codacy-coverage'
40
+ gem 'simplecov'
46
41
 
47
42
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
48
43
  gem 'rack', '2.1.2'
@@ -62,10 +57,6 @@ unless is_jruby
62
57
  gem 'rspec-command'
63
58
  end
64
59
 
65
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
66
- gem 'mime-types', '< 3.0'
67
- end
68
-
69
60
  gem 'webmock', :require => false
70
61
 
71
62
  gem 'aws-sdk-sqs'
@@ -34,15 +34,10 @@ platforms :rbx do
34
34
  gem 'rubysl', '~> 2.0' unless RUBY_VERSION.start_with?('1')
35
35
  end
36
36
 
37
- if RUBY_VERSION.start_with?('1.9')
38
- gem 'capistrano', '<= 3.4.1', :require => false
39
- gem 'sucker_punch', '~> 1.0'
40
- elsif RUBY_VERSION.start_with?('2')
41
- gem 'capistrano', :require => false
42
- gem 'sucker_punch', '~> 2.0'
43
- gem 'codacy-coverage'
44
- gem 'simplecov'
45
- end
37
+ gem 'capistrano', :require => false
38
+ gem 'sucker_punch', '~> 2.0'
39
+ gem 'codacy-coverage'
40
+ gem 'simplecov'
46
41
 
47
42
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
48
43
  gem 'rack', '2.1.2'
@@ -63,10 +58,6 @@ unless is_jruby
63
58
  gem 'rspec-command'
64
59
  end
65
60
 
66
- if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')
67
- gem 'mime-types', '< 3.0'
68
- end
69
-
70
61
  gem 'webmock', :require => false
71
62
 
72
63
  gem 'aws-sdk-sqs'
@@ -35,7 +35,7 @@ module Rollbar
35
35
  _cset(:rollbar_user) { ENV['USER'] || ENV['USERNAME'] }
36
36
  _cset(:rollbar_env) { fetch(:rails_env, 'production') }
37
37
  _cset(:rollbar_token) { abort("Please specify the Rollbar access token, set :rollbar_token, 'your token'") }
38
- _cset(:rollbar_revision) { current_revision }
38
+ _cset(:rollbar_revision) { real_revision }
39
39
  _cset(:rollbar_comment) { nil }
40
40
  end
41
41
  end
@@ -40,6 +40,9 @@ module Rollbar
40
40
  capistrano_300_warning(logger)
41
41
  logger.info opts[:desc] if opts[:desc]
42
42
  yield
43
+
44
+ rescue StandardError => e
45
+ logger.error "Error reporting to Rollbar: #{e.inspect}"
43
46
  end
44
47
 
45
48
  def deploy_update(capistrano, logger, dry_run, opts = {})
@@ -61,7 +64,11 @@ module Rollbar
61
64
  end
62
65
 
63
66
  def capistrano_300_warning(logger)
64
- logger.warn("You need to upgrade capistrano to '>= 3.1' version in order to correctly report deploys to Rollbar. (On 3.0, the reported revision will be incorrect.)") if ::Capistrano::VERSION =~ /^3\.0/
67
+ return unless ::Capistrano.const_defined?('VERSION') && ::Capistrano::VERSION =~ /^3\.0/
68
+
69
+ logger.warn('You need to upgrade capistrano to >= 3.1 version in order'\
70
+ 'to correctly report deploys to Rollbar. (On 3.0, the reported revision'\
71
+ 'will be incorrect.)')
65
72
  end
66
73
 
67
74
  def report_deploy_started(capistrano, dry_run)
@@ -83,6 +90,7 @@ module Rollbar
83
90
  def report_deploy_succeeded(capistrano, dry_run)
84
91
  ::Rollbar::Deploy.update(
85
92
  {
93
+ :comment => capistrano.fetch(:rollbar_comment),
86
94
  :proxy => :ENV,
87
95
  :dry_run => dry_run
88
96
  },
@@ -95,6 +103,7 @@ module Rollbar
95
103
  def report_deploy_failed(capistrano, dry_run)
96
104
  ::Rollbar::Deploy.update(
97
105
  {
106
+ :comment => capistrano.fetch(:rollbar_comment),
98
107
  :proxy => :ENV,
99
108
  :dry_run => dry_run
100
109
  },
@@ -19,6 +19,7 @@ module Rollbar
19
19
  attr_accessor :disable_core_monkey_patch
20
20
  attr_accessor :enable_error_context
21
21
  attr_accessor :dj_threshold
22
+ attr_accessor :async_skip_report_handler
22
23
  attr_accessor :enabled
23
24
  attr_accessor :endpoint
24
25
  attr_accessor :environment
@@ -84,8 +85,10 @@ module Rollbar
84
85
  DEFAULT_WEB_BASE = 'https://rollbar.com'.freeze
85
86
 
86
87
  def initialize
88
+ @access_token = nil
87
89
  @async_handler = nil
88
90
  @before_process = []
91
+ @branch = nil
89
92
  @capture_uncaught = nil
90
93
  @code_version = nil
91
94
  @custom_data_method = nil
@@ -97,6 +100,7 @@ module Rollbar
97
100
  @disable_rack_monkey_patch = false
98
101
  @enable_error_context = true
99
102
  @dj_threshold = 0
103
+ @async_skip_report_handler = nil
100
104
  @enabled = nil # set to true when configure is called
101
105
  @endpoint = DEFAULT_ENDPOINT
102
106
  @environment = nil
@@ -108,6 +112,7 @@ module Rollbar
108
112
  @failover_handlers = []
109
113
  @framework = 'Plain'
110
114
  @ignored_person_ids = []
115
+ @host = nil
111
116
  @payload_options = {}
112
117
  @person_method = 'current_user'
113
118
  @person_id_method = 'id'
@@ -119,6 +124,7 @@ module Rollbar
119
124
  @open_timeout = 3
120
125
  @request_timeout = 3
121
126
  @net_retries = 3
127
+ @root = nil
122
128
  @js_enabled = false
123
129
  @js_options = {}
124
130
  @locals = {}
@@ -148,6 +154,7 @@ module Rollbar
148
154
  @log_payload = false
149
155
  @collect_user_ip = true
150
156
  @anonymize_user_ip = false
157
+ @user_ip_obfuscator_secret = nil
151
158
  @backtrace_cleaner = nil
152
159
  @hooks = {
153
160
  :on_error_response => nil, # params: response
@@ -155,6 +162,7 @@ module Rollbar
155
162
  }
156
163
 
157
164
  @write_to_file = false
165
+ @filepath = nil
158
166
  @files_with_pid_name_enabled = false
159
167
  @files_processed_enabled = false
160
168
  @files_processed_duration = 60
@@ -10,10 +10,6 @@ module Rollbar
10
10
  mod.const_get(target, inherit)
11
11
  end
12
12
 
13
- def ruby_19?
14
- version?('1.9')
15
- end
16
-
17
13
  def version?(version)
18
14
  numbers = version.split('.')
19
15
 
@@ -21,8 +17,6 @@ module Rollbar
21
17
  end
22
18
 
23
19
  def timeout_exceptions
24
- return [] if ruby_19?
25
-
26
20
  [Net::ReadTimeout, Net::OpenTimeout]
27
21
  end
28
22
  end
@@ -698,8 +698,6 @@ module Rollbar
698
698
  end
699
699
 
700
700
  def handle_net_retries
701
- return yield if skip_retries?
702
-
703
701
  retries = configuration.net_retries - 1
704
702
 
705
703
  begin
@@ -713,10 +711,6 @@ module Rollbar
713
711
  end
714
712
  end
715
713
 
716
- def skip_retries?
717
- Rollbar::LanguageSupport.ruby_19?
718
- end
719
-
720
714
  def handle_response(response)
721
715
  if response.code == '200'
722
716
  log_info '[Rollbar] Success'
@@ -60,6 +60,10 @@ module Rollbar
60
60
  end
61
61
 
62
62
  def self.skip_report?(job)
63
+ handler = ::Rollbar.configuration.async_skip_report_handler
64
+
65
+ return handler.call(job) if handler.respond_to?(:call)
66
+
63
67
  job.attempts < ::Rollbar.configuration.dj_threshold
64
68
  end
65
69
 
@@ -1,6 +1,6 @@
1
1
 
2
2
  namespace :rollbar do
3
- desc 'Verify your gem installation by sending a test exception to Rollbar'
3
+ desc 'Verify your gem installation by sending a test message to Rollbar'
4
4
  task :test => [:environment] do
5
5
  rollbar_dir = Gem.loaded_specs['rollbar'].full_gem_path
6
6
  require "#{rollbar_dir}/lib/rollbar/rollbar_test"
@@ -131,6 +131,7 @@ module Rollbar
131
131
  host = host.split(',').first.strip unless host.empty?
132
132
 
133
133
  path = env['ORIGINAL_FULLPATH'] || env['REQUEST_URI']
134
+ path ||= "#{env['SCRIPT_NAME']}#{env['PATH_INFO']}#{"?#{env['QUERY_STRING']}" unless env['QUERY_STRING'].to_s.empty?}"
134
135
  unless path.nil? || path.empty?
135
136
  path = '/' + path.to_s if path.to_s.slice(0, 1) != '/'
136
137
  end
@@ -1,48 +1,16 @@
1
1
  require 'rollbar'
2
- begin
3
- require 'rack/mock'
4
- rescue LoadError
5
- puts 'Cannot load rack/mock'
6
- end
7
- require 'logger'
8
2
 
9
- # Module to inject into the Rails controllers or rack apps
10
3
  module RollbarTest # :nodoc:
11
- def test_rollbar
12
- puts 'Raising RollbarTestingException to simulate app failure.'
13
-
14
- raise RollbarTestingException.new, ::RollbarTest.success_message
15
- end
16
-
17
4
  def self.run
18
5
  return unless confirmed_token?
19
6
 
20
- configure_rails if defined?(Rails)
21
-
22
- puts 'Testing manual report...'
23
- Rollbar.error('Test error from rollbar:test')
24
-
25
- return unless defined?(Rack::MockRequest)
26
-
27
- protocol, app = setup_app
28
-
29
- puts 'Processing...'
30
- env = Rack::MockRequest.env_for("#{protocol}://www.example.com/verify", 'REMOTE_ADDR' => '127.0.0.1')
31
- status, = app.call(env)
32
-
33
- puts error_message unless status.to_i == 500
34
- end
35
-
36
- def self.configure_rails
37
- Rails.logger = if defined?(ActiveSupport::TaggedLogging)
38
- ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
39
- else
40
- Logger.new(STDOUT)
41
- end
7
+ puts 'Test sending to Rollbar...'
8
+ result = Rollbar.info('Test message from rollbar:test')
42
9
 
43
- Rails.logger.level = Logger::DEBUG
44
- Rollbar.preconfigure do |config|
45
- config.logger = Rails.logger
10
+ if result == 'error'
11
+ puts error_message
12
+ else
13
+ puts success_message
46
14
  end
47
15
  end
48
16
 
@@ -54,69 +22,6 @@ module RollbarTest # :nodoc:
54
22
  false
55
23
  end
56
24
 
57
- def self.authlogic_config
58
- # from http://stackoverflow.com/questions/5270835/authlogic-activation-problems
59
- return unless defined?(Authlogic)
60
-
61
- Authlogic::Session::Base.controller = Authlogic::ControllerAdapters::RailsAdapter.new(self)
62
- end
63
-
64
- def self.setup_app
65
- puts 'Setting up the test app.'
66
-
67
- if defined?(Rails)
68
- app = rails_app
69
-
70
- draw_rails_route(app)
71
-
72
- authlogic_config
73
-
74
- [rails_protocol(app), app]
75
- else
76
- ['http', rack_app]
77
- end
78
- end
79
-
80
- def self.rails_app
81
- # The setup below is needed for Rails 5.x, but not for Rails 4.x and below.
82
- # (And fails on Rails 4.x in various ways depending on the exact version.)
83
- return Rails.application if Rails.version < '5.0.0'
84
-
85
- # Spring now runs by default in development on all new Rails installs. This causes
86
- # the new `/verify` route to not get picked up if `config.cache_classes == false`
87
- # which is also a default in development env.
88
- #
89
- # `config.cache_classes` needs to be set, but the only possible time is at app load,
90
- # so here we clone the default app with an updated config.
91
- #
92
- config = Rails.application.config
93
- config.cache_classes = true
94
-
95
- # Make a copy of the app, so the config can be updated.
96
- Rails.application.class.name.constantize.new(:config => config)
97
- end
98
-
99
- def self.draw_rails_route(app)
100
- app.routes_reloader.execute_if_updated
101
- app.routes.draw do
102
- get 'verify' => 'rollbar_test#verify', :as => 'verify'
103
- end
104
- end
105
-
106
- def self.rails_protocol(app)
107
- defined?(app.config.force_ssl && app.config.force_ssl) ? 'https' : 'http'
108
- end
109
-
110
- def self.rack_app
111
- Class.new do
112
- include RollbarTest
113
-
114
- def self.call(_env)
115
- new.test_rollbar
116
- end
117
- end
118
- end
119
-
120
25
  def self.token_error_message
121
26
  'Rollbar needs an access token configured. Check the README for instructions.'
122
27
  end
@@ -129,19 +34,3 @@ module RollbarTest # :nodoc:
129
34
  'Testing rollbar with "rake rollbar:test". If you can see this, it works.'
130
35
  end
131
36
  end
132
-
133
- class RollbarTestingException < RuntimeError; end
134
-
135
- if defined?(Rails)
136
- class RollbarTestController < ActionController::Base # :nodoc:
137
- include RollbarTest
138
-
139
- def verify
140
- test_rollbar
141
- end
142
-
143
- def logger
144
- nil
145
- end
146
- end
147
- end
@@ -67,10 +67,7 @@ module Rollbar
67
67
 
68
68
  params = decode_www_form(query)
69
69
 
70
- encoded_query = encode_www_form(filter_query_params(params, regex, randomize_scrub_length, scrub_all, whitelist))
71
-
72
- # We want this to rebuild array params like foo[]=1&foo[]=2
73
- URI.escape(CGI.unescape(encoded_query))
70
+ encode_www_form(filter_query_params(params, regex, randomize_scrub_length, scrub_all, whitelist))
74
71
  end
75
72
 
76
73
  def decode_www_form(query)
@@ -78,7 +75,15 @@ module Rollbar
78
75
  end
79
76
 
80
77
  def encode_www_form(params)
81
- URI.encode_www_form(params)
78
+ restore_square_brackets(URI.encode_www_form(params))
79
+ end
80
+
81
+ def restore_square_brackets(query)
82
+ # We want this to rebuild array params like foo[]=1&foo[]=2
83
+ #
84
+ # URI.encode_www_form follows the spec at https://url.spec.whatwg.org/#concept-urlencoded-serializer
85
+ # and percent encodes square brackets. Here we change them back.
86
+ query.gsub('%5B', '[').gsub('%5D', ']')
82
87
  end
83
88
 
84
89
  def filter_query_params(params, regex, randomize_scrub_length, scrub_all, whitelist)
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = '2.26.0'.freeze
2
+ VERSION = '3.0.1'.freeze
3
3
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.files += ['spec/support/rollbar_api.rb'] # useful helper for app spec/tests.
17
17
  gem.name = 'rollbar'
18
18
  gem.require_paths = ['lib']
19
- gem.required_ruby_version = '>= 1.9.3'
19
+ gem.required_ruby_version = '>= 2.0.0'
20
20
  gem.version = Rollbar::VERSION
21
21
 
22
22
  if gem.respond_to?(:metadata)
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.26.0
4
+ version: 3.0.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: 2020-06-22 00:00:00.000000000 Z
11
+ date: 2020-10-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Easy and powerful exception tracking for Ruby
14
14
  email:
@@ -19,6 +19,7 @@ extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
21
  - ".codeclimate.yml"
22
+ - ".github/pull_request_template.md"
22
23
  - ".gitignore"
23
24
  - ".gitmodules"
24
25
  - ".rubocop.yml"
@@ -152,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
152
153
  requirements:
153
154
  - - ">="
154
155
  - !ruby/object:Gem::Version
155
- version: 1.9.3
156
+ version: 2.0.0
156
157
  required_rubygems_version: !ruby/object:Gem::Requirement
157
158
  requirements:
158
159
  - - ">="