rollbar 2.19.2 → 2.19.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +27 -0
  3. data/Appraisals +10 -10
  4. data/Gemfile +2 -0
  5. data/README.md +4 -1
  6. data/Rakefile +0 -0
  7. data/data/rollbar.snippet.js +1 -1
  8. data/gemfiles/rails30.gemfile +2 -0
  9. data/gemfiles/rails31.gemfile +2 -0
  10. data/gemfiles/rails32.gemfile +2 -0
  11. data/gemfiles/rails40.gemfile +2 -0
  12. data/gemfiles/rails41.gemfile +2 -0
  13. data/gemfiles/rails42.gemfile +2 -0
  14. data/gemfiles/rails50.gemfile +2 -0
  15. data/gemfiles/rails51.gemfile +2 -0
  16. data/gemfiles/rails52.gemfile +2 -0
  17. data/gemfiles/ruby_1_8_and_1_9_2.gemfile +2 -0
  18. data/lib/generators/rollbar/rollbar_generator.rb +1 -1
  19. data/lib/rails/rollbar_runner.rb +1 -1
  20. data/lib/rollbar.rb +2 -3
  21. data/lib/rollbar/capistrano3.rb +6 -3
  22. data/lib/rollbar/capistrano_tasks.rb +13 -15
  23. data/lib/rollbar/configuration.rb +10 -8
  24. data/lib/rollbar/delay/girl_friday.rb +2 -2
  25. data/lib/rollbar/delay/resque.rb +4 -6
  26. data/lib/rollbar/delay/sidekiq.rb +6 -10
  27. data/lib/rollbar/delay/sucker_punch.rb +17 -19
  28. data/lib/rollbar/delay/thread.rb +2 -2
  29. data/lib/rollbar/deploy.rb +47 -30
  30. data/lib/rollbar/encoding/encoder.rb +9 -9
  31. data/lib/rollbar/item.rb +7 -7
  32. data/lib/rollbar/item/backtrace.rb +4 -4
  33. data/lib/rollbar/item/frame.rb +7 -1
  34. data/lib/rollbar/item/locals.rb +56 -0
  35. data/lib/rollbar/json.rb +5 -2
  36. data/lib/rollbar/json/default.rb +1 -1
  37. data/lib/rollbar/json/oj.rb +1 -1
  38. data/lib/rollbar/language_support.rb +1 -1
  39. data/lib/rollbar/lazy_store.rb +5 -5
  40. data/lib/rollbar/logger.rb +1 -0
  41. data/lib/rollbar/logger_proxy.rb +1 -1
  42. data/lib/rollbar/middleware/js.rb +15 -15
  43. data/lib/rollbar/middleware/rack.rb +4 -1
  44. data/lib/rollbar/middleware/rails/rollbar.rb +10 -1
  45. data/lib/rollbar/notifier.rb +40 -15
  46. data/lib/rollbar/notifier/trace_with_bindings.rb +65 -0
  47. data/lib/rollbar/plugin.rb +54 -6
  48. data/lib/rollbar/plugins.rb +7 -1
  49. data/lib/rollbar/plugins/basic_socket.rb +21 -6
  50. data/lib/rollbar/plugins/delayed_job/job_data.rb +3 -3
  51. data/lib/rollbar/plugins/delayed_job/plugin.rb +2 -2
  52. data/lib/rollbar/plugins/goalie.rb +11 -3
  53. data/lib/rollbar/plugins/rails/controller_methods.rb +15 -3
  54. data/lib/rollbar/plugins/rake.rb +2 -2
  55. data/lib/rollbar/plugins/sidekiq/plugin.rb +5 -4
  56. data/lib/rollbar/rake_tasks.rb +2 -2
  57. data/lib/rollbar/request_data_extractor.rb +21 -18
  58. data/lib/rollbar/scrubbers.rb +7 -3
  59. data/lib/rollbar/scrubbers/params.rb +17 -16
  60. data/lib/rollbar/scrubbers/url.rb +8 -3
  61. data/lib/rollbar/truncation.rb +1 -1
  62. data/lib/rollbar/truncation/strings_strategy.rb +1 -1
  63. data/lib/rollbar/util/ip_anonymizer.rb +8 -7
  64. data/lib/rollbar/util/ip_obfuscator.rb +1 -1
  65. data/lib/rollbar/version.rb +1 -1
  66. data/lib/tasks/benchmark.rake +103 -0
  67. data/rollbar.gemspec +13 -4
  68. metadata +12 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 903833e1801aaeef919e56c575720bd7c4ae6498
4
- data.tar.gz: 2c7ee9fe31c1163a36da244d74390f9465515348
2
+ SHA256:
3
+ metadata.gz: 5503cff74b3885c82665a6d7ce5c491be89ba4a66e5176547dbe2249ab1be90b
4
+ data.tar.gz: 6cfe51c21ab4bc1ce799b1550f8d2096ed68ac608f41b35fbee170a91d208fd4
5
5
  SHA512:
6
- metadata.gz: 56d9ca0996cee011a87113a6a9271067286492c8c36537da01b93049784b072256982ba77efeb88938e2464f3e9771e6af1da5926e2dba02cf8cb07de4fe4628
7
- data.tar.gz: a4c0e26eb7def5137bc2737d0a837cab42677f24cc7983055ecd8586754222834e6095ee5a859c55443cdfb43c0c33e4ab6f98dfdb31adc20064d6fb25bf6b3f
6
+ metadata.gz: 63d85d9a87c65605f692ace193e8b1d2da282f73dfb834f38840929cb4d85354212ed0fd9b3d387c31ef8a60a7bf77ec273072b03ac4da645b7c07d118e270a3
7
+ data.tar.gz: d7f0973b1f0e6b07fe7f51c08e16e82e35966c575d806c696d40c6b4671786d700d1e121fba63662ccdbddbbf014b3c4fe44af34c1462050c9a8b35cd36aea29
@@ -34,3 +34,30 @@ Style/ExpandPathArguments:
34
34
 
35
35
  Gemspec/RequiredRubyVersion:
36
36
  Enabled: false # rubocop compares to gemspec, yet won't allow 1.9 as minimum version
37
+
38
+ Style/Encoding:
39
+ Enabled: false # Ruby 1.9.3 needs these magic comments, e.g. # encoding: UTF-8
40
+
41
+ Style/PercentLiteralDelimiters:
42
+ PreferredDelimiters:
43
+ # rubocop switched from () to [] at some past version.
44
+ # Make sure we are consistent across all bundles/builds.
45
+ default: '[]'
46
+
47
+ Style/Documentation:
48
+ # We can enabled this if/when we want to start doing consistent class documentation.
49
+ # As is, we currently add :nodoc: if anything at all.
50
+ Enabled: false
51
+
52
+ Naming/UncommunicativeMethodParamName:
53
+ # It's possible to configure this cop to allow just about anything, but what's the point.
54
+ # The default min length of a param name is 3, but the the default whitelist includes things
55
+ # like `db` and `io`. So, short names really can be useful.
56
+ Enabled: false
57
+
58
+ Style/CaseEquality:
59
+ # The code uses `===` a lot to compare a regex to a string, but it's not clear that
60
+ # switching to `=~` is always safe, because in some cases the value could be a regex
61
+ # or a string and `str1 =~ str2` isn't valid. Whoever enables this cop should carefully
62
+ # review and test each of these.
63
+ Enabled: false
data/Appraisals CHANGED
@@ -1,19 +1,19 @@
1
- appraise "rails30" do
2
- gem "rails", "3.0.20"
1
+ appraise 'rails30' do
2
+ gem 'rails', '3.0.20'
3
3
  end
4
4
 
5
- appraise "rails31" do
6
- gem "rails", "3.1.12"
5
+ appraise 'rails31' do
6
+ gem 'rails', '3.1.12'
7
7
  end
8
8
 
9
- appraise "rails32" do
10
- gem "rails", "3.2.21"
9
+ appraise 'rails32' do
10
+ gem 'rails', '3.2.21'
11
11
  end
12
12
 
13
- appraise "rails40" do
14
- gem "rails", "4.0.13"
13
+ appraise 'rails40' do
14
+ gem 'rails', '4.0.13'
15
15
  end
16
16
 
17
- appraise "rails41" do
18
- gem "rails", "4.1.9"
17
+ appraise 'rails41' do
18
+ gem 'rails', '4.1.9'
19
19
  end
data/Gemfile CHANGED
@@ -36,9 +36,11 @@ platforms :rbx do
36
36
  end
37
37
 
38
38
  if RUBY_VERSION.start_with?('1.9')
39
+ gem 'capistrano', '<= 3.4.1', :require => false
39
40
  gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
40
41
  gem 'sucker_punch', '~> 1.0'
41
42
  elsif RUBY_VERSION.start_with?('2')
43
+ gem 'capistrano', :require => false # rubocop:disable Bundler/DuplicatedGem
42
44
  gem 'codacy-coverage'
43
45
  gem 'shoryuken' # rubocop:disable Bundler/DuplicatedGem
44
46
  gem 'simplecov'
data/README.md CHANGED
@@ -3,9 +3,12 @@
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
 
6
+
6
7
  > WARNING: Ruby 2.6.0 introduced a new bug bug ([#15472 -
7
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)).
8
- > Until the Ruby maintainers have released the fix for this bug, we advise Rollbar users to not upgrade their applications to Ruby 2.6.0.
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.
9
12
 
10
13
 
11
14
 
data/Rakefile CHANGED
File without changes
@@ -1 +1 @@
1
- !function(r){function e(n){if(o[n])return o[n].exports;var t=o[n]={exports:{},id:n,loaded:!1};return r[n].call(t.exports,t,t.exports,e),t.loaded=!0,t.exports}var o={};return e.m=r,e.c=o,e.p="",e(0)}([function(r,e,o){"use strict";var n=o(1),t=o(4);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.4.4/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";function n(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}function t(r,e){this.options=r,this._rollbarOldOnError=null;var o=s++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}function a(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var t=new p(e);return n(function(){e.captureUncaught&&(t._rollbarOldOnError=r.onerror,i.captureUncaughtExceptions(r,t,!0),i.wrapGlobals(r,t,!0)),e.captureUnhandledRejections&&i.captureUnhandledRejections(r,t,!0);var n=e.autoInstrument;return e.enabled!==!1&&(void 0===n||n===!0||"object"==typeof n&&n.network)&&r.addEventListener&&(r.addEventListener("load",t.captureLoad.bind(t)),r.addEventListener("DOMContentLoaded",t.captureDomContentLoaded.bind(t))),r[o]=t,t})()}}function l(r){return n(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)})}var i=o(2),s=0,d=o(3),c=function(r,e){return new t(r,e)},p=function(r){return new d(c,r)};t.prototype.loadFull=function(r,e,o,t,a){var l=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(l=t[i],"function"==typeof l){l(e);break}}"function"==typeof a&&a(e)},i=!1,s=e.createElement("script"),d=e.getElementsByTagName("script")[0],c=d.parentNode;s.crossOrigin="",s.src=t.rollbarJsUrl,o||(s.async=!0),s.onload=s.onreadystatechange=n(function(){if(!(i||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){s.onload=s.onreadystatechange=null;try{c.removeChild(s)}catch(r){}i=!0,l()}}),c.insertBefore(s,d)},t.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,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),f=0;f<u.length;++f)t.prototype[u[f]]=l(u[f]);r.exports={setupShim:a,Rollbar:p}},function(r,e){"use strict";function o(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}var a=function(){var o=Array.prototype.slice.call(arguments,0);n(r,e,t,o)};o&&(a._rollbarOldOnError=t),r.onerror=a}}function n(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null),e.handleUncaughtException.apply(e,n),o&&o.apply(r,n)}function t(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){t="[unhandledrejection] error getting `detail` from event"}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 a(r,e,o){if(r){var n,t,a="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<a.length;++n)t=a[n],r[t]&&r[t].prototype&&l(e,r[t].prototype,o)}}function l(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:o,captureUnhandledRejections:t,wrapGlobals:a}},function(r,e){"use strict";function o(r,e){this.impl=r(e,this),this.options=e,n(o.prototype)}function n(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,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}o.prototype._swapAndProcessMessages=function(r,e){this.impl=r(this.options);for(var o,n,t;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){"use strict";r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){r=r||{};for(var o,n,t=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){function o(n){if(e[n])return e[n].exports;var t=e[n]={exports:{},id:n,loaded:!1};return r[n].call(t.exports,t,t.exports,o),t.loaded=!0,t.exports}var e={};return o.m=r,o.c=e,o.p="",o(0)}([function(r,o,e){"use strict";var n=e(1),t=e(4);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.5.4/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,o,e){"use strict";function n(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}function t(r,o){this.options=r,this._rollbarOldOnError=null;var e=s++;this.shimId=function(){return e},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[e]={handler:o,messages:[]})}function a(r,o){if(r){var e=o.globalAlias||"Rollbar";if("object"==typeof r[e])return r[e];r._rollbarShims={},r._rollbarWrappedError=null;var t=new p(o);return n(function(){o.captureUncaught&&(t._rollbarOldOnError=r.onerror,i.captureUncaughtExceptions(r,t,!0),i.wrapGlobals(r,t,!0)),o.captureUnhandledRejections&&i.captureUnhandledRejections(r,t,!0);var n=o.autoInstrument;return o.enabled!==!1&&(void 0===n||n===!0||"object"==typeof n&&n.network)&&r.addEventListener&&(r.addEventListener("load",t.captureLoad.bind(t)),r.addEventListener("DOMContentLoaded",t.captureDomContentLoaded.bind(t))),r[e]=t,t})()}}function l(r){return n(function(){var o=this,e=Array.prototype.slice.call(arguments,0),n={shim:o,method:r,args:e,ts:new Date};window._rollbarShims[this.shimId()].messages.push(n)})}var i=e(2),s=0,d=e(3),c=function(r,o){return new t(r,o)},p=function(r){return new d(c,r)};t.prototype.loadFull=function(r,o,e,t,a){var l=function(){var o;if(void 0===r._rollbarDidLoad){o=new Error("rollbar.js did not load");for(var e,n,t,l,i=0;e=r._rollbarShims[i++];)for(e=e.messages||[];n=e.shift();)for(t=n.args||[],i=0;i<t.length;++i)if(l=t[i],"function"==typeof l){l(o);break}}"function"==typeof a&&a(o)},i=!1,s=o.createElement("script"),d=o.getElementsByTagName("script")[0],c=d.parentNode;s.crossOrigin="",s.src=t.rollbarJsUrl,e||(s.async=!0),s.onload=s.onreadystatechange=n(function(){if(!(i||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){s.onload=s.onreadystatechange=null;try{c.removeChild(s)}catch(r){}i=!0,l()}}),c.insertBefore(s,d)},t.prototype.wrap=function(r,o,e){try{var n;if(n="function"==typeof o?o:function(){return o||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){e&&"function"==typeof e&&e.apply(this,arguments);try{return r.apply(this,arguments)}catch(e){var o=e;throw o&&("string"==typeof o&&(o=new String(o)),o._rollbarContext=n()||{},o._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=o),o}},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(o){return r}};for(var u="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),f=0;f<u.length;++f)t.prototype[u[f]]=l(u[f]);r.exports={setupShim:a,Rollbar:p}},function(r,o){"use strict";function e(r,o,e){if(r){var t;if("function"==typeof o._rollbarOldOnError)t=o._rollbarOldOnError;else if(r.onerror){for(t=r.onerror;t._rollbarOldOnError;)t=t._rollbarOldOnError;o._rollbarOldOnError=t}var a=function(){var e=Array.prototype.slice.call(arguments,0);n(r,o,t,e)};e&&(a._rollbarOldOnError=t),r.onerror=a}}function n(r,o,e,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null),o.handleUncaughtException.apply(o,n),e&&e.apply(r,n)}function t(r,o,e){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var e,n,t;try{e=r.reason}catch(r){e=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!e&&t&&(e=t.reason,n=t.promise)}catch(r){}e||(e="[unhandledrejection] error getting `reason` from event"),o&&o.handleUnhandledRejection&&o.handleUnhandledRejection(e,n)};n.belongsToShim=e,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}}function a(r,o,e){if(r){var n,t,a="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<a.length;++n)t=a[n],r[t]&&r[t].prototype&&l(o,r[t].prototype,e)}}function l(r,o,e){if(o.hasOwnProperty&&o.hasOwnProperty("addEventListener")){for(var n=o.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(o,e,t){n.call(this,o,r.wrap(e),t)};t._rollbarOldAdd=n,t.belongsToShim=e,o.addEventListener=t;for(var a=o.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,o,e){a.call(this,r,o&&o._rollbar_wrapped||o,e)};l._rollbarOldRemove=a,l.belongsToShim=e,o.removeEventListener=l}}r.exports={captureUncaughtExceptions:e,captureUnhandledRejections:t,wrapGlobals:a}},function(r,o){"use strict";function e(r,o){this.impl=r(o,this),this.options=o,n(e.prototype)}function n(r){for(var o=function(r){return function(){var o=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,o)}},e="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<e.length;n++)r[e[n]]=o(e[n])}e.prototype._swapAndProcessMessages=function(r,o){this.impl=r(this.options);for(var e,n,t;e=o.shift();)n=e.method,t=e.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],e.ts]):this[n].apply(this,t));return this},r.exports=e},function(r,o){"use strict";r.exports=function(r){return function(o){if(!o&&!window._rollbarInitialized){r=r||{};for(var e,n,t=r.globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;e=window._rollbarShims[i++];)n||(n=e.handler),e.handler._swapAndProcessMessages(l,e.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
@@ -37,9 +37,11 @@ platforms :rbx do
37
37
  end
38
38
 
39
39
  if RUBY_VERSION.start_with?('1.9')
40
+ gem 'capistrano', '<= 3.4.1', :require => false
40
41
  gem 'sucker_punch', '~> 1.0'
41
42
  gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
42
43
  elsif RUBY_VERSION.start_with?('2')
44
+ gem 'capistrano', :require => false
43
45
  gem 'sucker_punch', '~> 2.0'
44
46
  gem 'shoryuken'
45
47
  gem 'codacy-coverage'
@@ -35,9 +35,11 @@ platforms :rbx do
35
35
  end
36
36
 
37
37
  if RUBY_VERSION.start_with?('1.9')
38
+ gem 'capistrano', '<= 3.4.1', :require => false
38
39
  gem 'sucker_punch'
39
40
  gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
40
41
  elsif RUBY_VERSION.start_with?('2')
42
+ gem 'capistrano', :require => false
41
43
  gem 'sucker_punch'
42
44
  gem 'shoryuken'
43
45
  gem 'codacy-coverage'
@@ -37,9 +37,11 @@ platforms :rbx do
37
37
  end
38
38
 
39
39
  if RUBY_VERSION.start_with?('1.9')
40
+ gem 'capistrano', '<= 3.4.1', :require => false
40
41
  gem 'sucker_punch', '~> 1.0'
41
42
  gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
42
43
  elsif RUBY_VERSION.start_with?('2')
44
+ gem 'capistrano', :require => false
43
45
  gem 'sucker_punch', '~> 2.0'
44
46
  gem 'shoryuken'
45
47
  gem 'codacy-coverage'
@@ -37,10 +37,12 @@ platforms :rbx do
37
37
  end
38
38
 
39
39
  if RUBY_VERSION.start_with?('1.9')
40
+ gem 'capistrano', '<= 3.4.1', :require => false
40
41
  gem 'sucker_punch', '~> 1.0'
41
42
  gem 'json', '~> 1.8'
42
43
  gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
43
44
  elsif RUBY_VERSION.start_with?('2')
45
+ gem 'capistrano', :require => false
44
46
  gem 'sucker_punch', '~> 2.0'
45
47
  gem 'json', '~> 2.0'
46
48
  gem 'shoryuken'
@@ -34,9 +34,11 @@ platforms :rbx do
34
34
  end
35
35
 
36
36
  if RUBY_VERSION.start_with?('1.9')
37
+ gem 'capistrano', '<= 3.4.1', :require => false
37
38
  gem 'sucker_punch', '~> 1.0'
38
39
  gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
39
40
  elsif RUBY_VERSION.start_with?('2')
41
+ gem 'capistrano', :require => false
40
42
  gem 'sucker_punch', '~> 2.0'
41
43
  gem 'shoryuken'
42
44
  gem 'codacy-coverage'
@@ -37,8 +37,10 @@ else
37
37
  end
38
38
 
39
39
  if RUBY_VERSION.start_with?('1.9')
40
+ gem 'capistrano', '<= 3.4.1', :require => false
40
41
  gem 'shoryuken', '>= 4.0.0', '<= 4.0.2'
41
42
  elsif RUBY_VERSION.start_with?('2')
43
+ gem 'capistrano', :require => false
42
44
  gem 'shoryuken'
43
45
  end
44
46
 
@@ -38,8 +38,10 @@ platforms :rbx do
38
38
  end
39
39
 
40
40
  if RUBY_VERSION.start_with?('1.9')
41
+ gem 'capistrano', '<= 3.4.1', :require => false
41
42
  gem 'sucker_punch', '~> 1.0'
42
43
  elsif RUBY_VERSION.start_with?('2')
44
+ gem 'capistrano', :require => false
43
45
  gem 'sucker_punch', '~> 2.0'
44
46
  gem 'codacy-coverage'
45
47
  gem 'simplecov'
@@ -38,8 +38,10 @@ platforms :rbx do
38
38
  end
39
39
 
40
40
  if RUBY_VERSION.start_with?('1.9')
41
+ gem 'capistrano', '<= 3.4.1', :require => false
41
42
  gem 'sucker_punch', '~> 1.0'
42
43
  elsif RUBY_VERSION.start_with?('2')
44
+ gem 'capistrano', :require => false
43
45
  gem 'sucker_punch', '~> 2.0'
44
46
  gem 'codacy-coverage'
45
47
  gem 'simplecov'
@@ -59,4 +59,6 @@ gem 'webmock', :require => false
59
59
  gem 'aws-sdk-sqs'
60
60
  gem 'shoryuken'
61
61
 
62
+ gem 'capistrano', :require => false
63
+
62
64
  gemspec :path => '../'
@@ -46,4 +46,6 @@ if Gem::Version.new(ruby_version) < Gem::Version.new('2.0')
46
46
  gem 'mime-types', '< 3.0'
47
47
  end
48
48
 
49
+ gem 'capistrano', '<= 3.4.1', :require => false
50
+
49
51
  gemspec :path => '../'
@@ -52,7 +52,7 @@ module Rollbar
52
52
  end
53
53
 
54
54
  def access_token_configured?
55
- File.exists?('config/initializers/rollbar.rb')
55
+ File.exist?('config/initializers/rollbar.rb')
56
56
  end
57
57
  end
58
58
  end
@@ -60,7 +60,7 @@ module Rails
60
60
 
61
61
  def rollbar_managed
62
62
  yield
63
- rescue => e
63
+ rescue StandardError => e
64
64
  Rollbar.scope(:custom => { :command => command }).error(e)
65
65
  raise
66
66
  end
@@ -1,7 +1,6 @@
1
1
  require 'net/protocol'
2
2
  require 'net/https'
3
3
  require 'socket'
4
- require 'thread'
5
4
  require 'uri'
6
5
  require 'open-uri'
7
6
  require 'forwardable'
@@ -22,10 +21,10 @@ require 'rollbar/notifier'
22
21
  # The Rollbar module. It stores a Rollbar::Notifier per thread and
23
22
  # provides some module methods in order to use the current thread notifier.
24
23
  module Rollbar
25
- PUBLIC_NOTIFIER_METHODS = %w(debug info warn warning error critical log logger
24
+ PUBLIC_NOTIFIER_METHODS = %w[debug info warn warning error critical log logger
26
25
  process_item process_from_async_handler scope
27
26
  send_failsafe log_info log_debug log_warning
28
- log_error silenced scope_object).freeze
27
+ log_error silenced scope_object].freeze
29
28
 
30
29
  class << self
31
30
  extend Forwardable
@@ -7,24 +7,27 @@ require 'rollbar/deploy'
7
7
  require 'rollbar/capistrano_tasks'
8
8
 
9
9
  namespace :rollbar do
10
+ # dry_run? wasn't introduced till Capistrano 3.5.0; use the old fetch(:sshkit_backed)
11
+ set :dry_run, (proc { ::Capistrano::Configuration.env.fetch(:sshkit_backend) == ::SSHKit::Backend::Printer })
12
+
10
13
  desc 'Send deployment started notification to Rollbar.'
11
14
  task :deploy_started do
12
15
  on primary fetch(:rollbar_role) do
13
- ::Rollbar::CapistranoTasks.deploy_started(self, self, false)
16
+ ::Rollbar::CapistranoTasks.deploy_started(self, self, fetch(:dry_run))
14
17
  end
15
18
  end
16
19
 
17
20
  desc 'Send deployment succeeded notification to Rollbar.'
18
21
  task :deploy_succeeded do
19
22
  on primary fetch(:rollbar_role) do
20
- ::Rollbar::CapistranoTasks.deploy_succeeded(self, self, false)
23
+ ::Rollbar::CapistranoTasks.deploy_succeeded(self, self, fetch(:dry_run))
21
24
  end
22
25
  end
23
26
 
24
27
  desc 'Send deployment failed notification to Rollbar.'
25
28
  task :deploy_failed do
26
29
  on primary fetch(:rollbar_role) do
27
- ::Rollbar::CapistranoTasks.deploy_failed(self, self, false)
30
+ ::Rollbar::CapistranoTasks.deploy_failed(self, self, fetch(:dry_run))
28
31
  end
29
32
  end
30
33
 
@@ -1,5 +1,3 @@
1
- require 'capistrano'
2
- require 'capistrano/version'
3
1
  require 'rollbar/deploy'
4
2
 
5
3
  module Rollbar
@@ -15,10 +13,10 @@ module Rollbar
15
13
  capistrano.set(:rollbar_deploy_id, 123) if dry_run
16
14
 
17
15
  skip_in_dry_run(logger, dry_run) do
18
- if (deploy_id = result[:data] && result[:data][:deploy_id])
16
+ if result[:success] && (deploy_id = result[:data] && result[:data][:deploy_id])
19
17
  capistrano.set :rollbar_deploy_id, deploy_id
20
18
  else
21
- logger.error 'Unable to report deploy to Rollbar'
19
+ logger.error 'Unable to report deploy to Rollbar' + (result[:message] ? ': ' + result[:message] : '')
22
20
  end
23
21
  end
24
22
  end
@@ -52,10 +50,10 @@ module Rollbar
52
50
  debug_request_response(logger, result)
53
51
 
54
52
  skip_in_dry_run(logger, dry_run) do
55
- if result[:response].is_a?(Net::HTTPSuccess)
53
+ if result[:success]
56
54
  logger.info 'Updated deploy status in Rollbar'
57
55
  else
58
- logger.error 'Unable to update deploy status in Rollbar'
56
+ logger.error 'Unable to update deploy status in Rollbar' + (result[:message] ? ': ' + result[:message] : '')
59
57
  end
60
58
  end
61
59
  end
@@ -76,9 +74,9 @@ module Rollbar
76
74
  :proxy => :ENV,
77
75
  :dry_run => dry_run
78
76
  },
79
- :access_token => capistrano.fetch(:rollbar_token),
80
- :environment => capistrano.fetch(:rollbar_env),
81
- :revision => capistrano.fetch(:rollbar_revision)
77
+ capistrano.fetch(:rollbar_token),
78
+ capistrano.fetch(:rollbar_env),
79
+ capistrano.fetch(:rollbar_revision)
82
80
  )
83
81
  end
84
82
 
@@ -88,9 +86,9 @@ module Rollbar
88
86
  :proxy => :ENV,
89
87
  :dry_run => dry_run
90
88
  },
91
- :access_token => capistrano.fetch(:rollbar_token),
92
- :deploy_id => capistrano.fetch(:rollbar_deploy_id),
93
- :status => :succeeded
89
+ capistrano.fetch(:rollbar_token),
90
+ capistrano.fetch(:rollbar_deploy_id),
91
+ :succeeded
94
92
  )
95
93
  end
96
94
 
@@ -100,9 +98,9 @@ module Rollbar
100
98
  :proxy => :ENV,
101
99
  :dry_run => dry_run
102
100
  },
103
- :access_token => capistrano.fetch(:rollbar_token),
104
- :deploy_id => capistrano.fetch(:rollbar_deploy_id),
105
- :status => :failed
101
+ capistrano.fetch(:rollbar_token),
102
+ capistrano.fetch(:rollbar_deploy_id),
103
+ :failed
106
104
  )
107
105
  end
108
106
 
@@ -27,6 +27,7 @@ module Rollbar
27
27
  attr_accessor :framework
28
28
  attr_accessor :ignored_person_ids
29
29
  attr_accessor :host
30
+ attr_accessor :locals
30
31
  attr_writer :logger
31
32
  attr_accessor :payload_options
32
33
  attr_accessor :person_method
@@ -65,10 +66,10 @@ module Rollbar
65
66
 
66
67
  attr_reader :project_gem_paths
67
68
 
68
- alias_method :safely?, :safely
69
+ alias safely? safely
69
70
 
70
- DEFAULT_ENDPOINT = 'https://api.rollbar.com/api/1/item/'
71
- DEFAULT_WEB_BASE = 'https://rollbar.com'
71
+ DEFAULT_ENDPOINT = 'https://api.rollbar.com/api/1/item/'.freeze
72
+ DEFAULT_WEB_BASE = 'https://rollbar.com'.freeze
72
73
 
73
74
  def initialize
74
75
  @async_handler = nil
@@ -107,6 +108,7 @@ module Rollbar
107
108
  @net_retries = 3
108
109
  @js_enabled = false
109
110
  @js_options = {}
111
+ @locals = {}
110
112
  @scrub_fields = [:passwd, :password, :password_confirmation, :secret,
111
113
  :confirm_password, :password_confirmation, :secret_token,
112
114
  :api_key, :access_token, :session_id]
@@ -132,7 +134,7 @@ module Rollbar
132
134
  @anonymize_user_ip = false
133
135
  @hooks = {
134
136
  :on_error_response => nil, # params: response
135
- :on_report_internal_error => nil, # params: exception
137
+ :on_report_internal_error => nil # params: exception
136
138
  }
137
139
  end
138
140
 
@@ -141,7 +143,7 @@ module Rollbar
141
143
 
142
144
  instance_variables.each do |var|
143
145
  instance_var = instance_variable_get(var)
144
- instance_variable_set(var, Rollbar::Util::deep_copy(instance_var))
146
+ instance_variable_set(var, Rollbar::Util.deep_copy(instance_var))
145
147
  end
146
148
  end
147
149
 
@@ -224,7 +226,7 @@ module Rollbar
224
226
  @async_handler = Rollbar::Delay::SuckerPunch
225
227
  end
226
228
 
227
- def use_sucker_punch=(value)
229
+ def use_sucker_punch=(_value)
228
230
  deprecation_message = '#use_sucker_punch=(value) has been deprecated in favor of #use_sucker_punch. Please update your rollbar configuration.'
229
231
  defined?(ActiveSupport) ? ActiveSupport::Deprecation.warn(deprecation_message) : puts(deprecation_message)
230
232
 
@@ -276,14 +278,14 @@ module Rollbar
276
278
  end
277
279
 
278
280
  def hook(symbol, &block)
279
- if @hooks.has_key?(symbol)
281
+ if @hooks.key?(symbol)
280
282
  if block_given?
281
283
  @hooks[symbol] = block
282
284
  else
283
285
  @hooks[symbol]
284
286
  end
285
287
  else
286
- raise StandardError.new "Hook :" + symbol.to_s + " is not supported by Rollbar SDK."
288
+ raise StandardError, 'Hook :' + symbol.to_s + ' is not supported by Rollbar SDK.'
287
289
  end
288
290
  end
289
291
 
@@ -11,10 +11,10 @@ module Rollbar
11
11
  end
12
12
 
13
13
  def queue
14
- @queue ||= self.queue_class.new(nil, :size => 5) do |payload|
14
+ @queue ||= queue_class.new(nil, :size => 5) do |payload|
15
15
  begin
16
16
  Rollbar.process_from_async_handler(payload)
17
- rescue
17
+ rescue StandardError
18
18
  # According to https://github.com/mperham/girl_friday/wiki#error-handling
19
19
  # we reraise the exception so it can be handled some way
20
20
  raise