rollbar 3.3.0 → 3.3.2

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: c88b1bd8659724cc0d0351d4efb1a458ec8af8e466ddaf6a453e6acaa6da6bd9
4
- data.tar.gz: 7961e62c55a4f147644cd203ca279b188a7ec3061f15b7ce88943591ccf87e07
3
+ metadata.gz: 96ef666aefbc42a6c9ca188bc402eeaf6ebded4e5cddf43331596f9fe9f46cfa
4
+ data.tar.gz: c5d63af42130d86639793bae8d39ba20b82d85aa6dfec3afd5d5bdc6eddab669
5
5
  SHA512:
6
- metadata.gz: fce360ce571930f495008f786bbc41ed649a7ee9d0e1e23e81a5e050b9310dbf4fc50952f62236d23d5a27f8057efc4c030a321207357423526cffa38d07355c
7
- data.tar.gz: 759e0e90848534ea09cbfd6ffe866f2d75e314fc56e2bdd7dbd6a48a428691ae5c42d2ec5a158638ba74148456674b01d5450f5cea1198e3148bc6dd69ce545a
6
+ metadata.gz: '09ccb737d948861e53bd9a59ddbde6c83362495fa1ef635d14a43ba2d2cab3c48279df9fb15a4118c843e4699f93d75820e3535ec52a770b7324b575ad2b28d2'
7
+ data.tar.gz: 6d1b06208d8daec4361fb4c895be6934a73e0fb33bd7ff7996d6353d27395e20513e0a0929d7d1bb5ee39dccf15430a12d988d4abb5ee0438a62ba06dcbf4c91
@@ -1,14 +1,23 @@
1
1
  ## Description of the change
2
2
 
3
- > Description here
3
+ > Please include a summary of the change and which issues are fixed.
4
+ > Please also include relevant motivation and context.
5
+
4
6
  ## Type of change
7
+
5
8
  - [ ] Bug fix (non-breaking change that fixes an issue)
6
9
  - [ ] New feature (non-breaking change that adds functionality)
7
10
  - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
11
+ - [ ] Maintenance
12
+ - [ ] New release
8
13
 
9
14
  ## Related issues
10
15
 
11
- > Fix [#1]()
16
+ > Shortcut stories and GitHub issues (delete irrelevant)
17
+
18
+ - Fix [SC-]
19
+ - Fix #1
20
+
12
21
  ## Checklists
13
22
 
14
23
  ### Development
@@ -17,9 +26,9 @@
17
26
  - [ ] The code changed/added as part of this pull request has been covered with tests
18
27
  - [ ] All tests related to the changed code pass in development
19
28
 
20
- ### Code review
29
+ ### Code review
21
30
 
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
31
+ - [ ] This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
32
+ - [ ] "Ready for review" label attached to the PR and reviewers assigned
33
+ - [ ] Issue from task tracker has a link to this pull request
24
34
  - [ ] Changes have been reviewed by at least one other engineer
25
- - [ ] Issue from task tracker has a link to this pull request
@@ -11,42 +11,26 @@ jobs:
11
11
  runs-on: ubuntu-18.04
12
12
  strategy:
13
13
  matrix:
14
- ruby-version: [2.2.10, 2.3.0, 2.3.8, 2.4.5, 2.5.3, 2.6.0, 2.6.6, 2.7.2]
14
+ ruby-version: [2.5.3, 2.6.0, 2.6.6, 2.7.2]
15
15
  gemfile:
16
- - gemfiles/rails42.gemfile
17
16
  - gemfiles/rails50.gemfile
18
17
  - gemfiles/rails51.gemfile
19
18
  - gemfiles/rails52.gemfile
20
19
  - gemfiles/rails60.gemfile
21
20
  - gemfiles/rails61.gemfile
22
- exclude:
23
- - gemfile: gemfiles/rails42.gemfile
24
- ruby-version: 2.7.2
25
- - gemfile: gemfiles/rails42.gemfile
26
- ruby-version: 2.6.0
21
+ include:
22
+ - gemfile: gemfiles/rails70.gemfile
23
+ ruby-version: 3.1.1
24
+ - gemfile: gemfiles/rails70.gemfile
25
+ ruby-version: 3.0.3
26
+ - gemfile: gemfiles/rails61.gemfile
27
+ ruby-version: 3.0.3
27
28
  - gemfile: gemfiles/rails42.gemfile
28
- ruby-version: 2.6.6
29
+ ruby-version: 2.4.5
29
30
  - gemfile: gemfiles/rails42.gemfile
30
- ruby-version: 2.7.2
31
- - gemfile: gemfiles/rails52.gemfile
32
- ruby-version: 2.2.10
33
- - gemfile: gemfiles/rails60.gemfile
34
- ruby-version: 2.2.10
35
- - gemfile: gemfiles/rails60.gemfile
36
- ruby-version: 2.3.0
37
- - gemfile: gemfiles/rails60.gemfile
38
31
  ruby-version: 2.3.8
39
- - gemfile: gemfiles/rails60.gemfile
40
- ruby-version: 2.4.5
41
- - gemfile: gemfiles/rails61.gemfile
32
+ - gemfile: gemfiles/rails42.gemfile
42
33
  ruby-version: 2.2.10
43
- - gemfile: gemfiles/rails61.gemfile
44
- ruby-version: 2.3.0
45
- - gemfile: gemfiles/rails61.gemfile
46
- ruby-version: 2.3.8
47
- - gemfile: gemfiles/rails61.gemfile
48
- ruby-version: 2.4.5
49
- include:
50
34
  - gemfile: gemfiles/rails41.gemfile
51
35
  ruby-version: 2.3.0
52
36
  - gemfile: gemfiles/rails41.gemfile
@@ -67,8 +51,6 @@ jobs:
67
51
  ruby-version: 2.0.0
68
52
  - gemfile: gemfiles/rails30.gemfile
69
53
  ruby-version: 2.0.0
70
- - gemfile: gemfiles/rails61.gemfile
71
- ruby-version: 3.0.0
72
54
 
73
55
  steps:
74
56
  - uses: actions/checkout@v2
@@ -115,4 +97,8 @@ jobs:
115
97
  bundle install --jobs 4 --retry 3
116
98
 
117
99
  - name: Rspec
118
- run: bundle exec rspec
100
+ run: |
101
+ export BUNDLE_GEMFILE=${{ matrix.gemfile }}
102
+ bundle config path vendor/bundle
103
+ bundle config gemfile ${{ matrix.gemfile }}
104
+ bundle exec rspec
data/.rubocop.yml CHANGED
@@ -19,27 +19,16 @@ Layout/HeredocIndentation:
19
19
  Layout/LineLength:
20
20
  Max: 90
21
21
 
22
- Lint/ConstantDefinitionInBlock:
23
- # We routinely update existing class definitions in conditional blocks.
24
- Enabled: false
25
-
26
22
  Lint/SendWithMixinArgument:
27
23
  # Object#include is still a private method in Ruby 2.0.
28
24
  Enabled: false
29
25
 
30
26
  Metrics/BlockLength:
31
- # RSpec DSL is expected to have long blocks.
32
- IgnoredMethods: ['describe', 'context', 'it', 'shared_examples']
27
+ ExcludedMethods: ['describe', 'context'] # RSpec DSL is expected to have long blocks.
33
28
 
34
29
  Metrics/MethodLength:
35
30
  Max: 15 # Relax slightly from the default of 10
36
31
 
37
- Metrics/ParameterLists:
38
- # We currently don't have limits on the number of method arguments, except as
39
- # they contribute to the complexity metric. If method complexity is in bounds,
40
- # we allow any number of arguments.
41
- Enabled: false
42
-
43
32
  Naming/MethodParameterName:
44
33
  # It's possible to configure this cop to allow just about anything, but what's the point.
45
34
  # The default min length of a param name is 3, but the the default whitelist includes things
@@ -80,29 +69,9 @@ Style/HashSyntax:
80
69
  SupportedStyles:
81
70
  - hash_rockets
82
71
 
83
- Style/HashTransformKeys:
84
- # Hash#transform_keys isn't available until Ruby 2.5
85
- Enabled: false
86
-
87
72
  Style/Lambda:
88
73
  Enabled: false
89
74
 
90
- Style/NumericPredicate:
91
- # Numbers used in comparison expressions are often more readable and consistent
92
- # than using predicate methods. e.g.
93
- # major > 0 && minor > 8
94
- # is more readable than
95
- # major.positive? && minor > 8
96
- Enabled: false
97
-
98
- Style/OptionalBooleanParameter:
99
- # We don't yet generally use keyword arguments. Ruby < 2.1 doesn't support
100
- # required kayword arguments. And satifying this rule would change the calling
101
- # convention only for these specific optional boolean arguments.
102
- # This rule should be enabled when the project is updated to use keyword
103
- # arguments in general.
104
- Enabled: false
105
-
106
75
  Style/PercentLiteralDelimiters:
107
76
  PreferredDelimiters:
108
77
  # rubocop switched from () to [] at some past version.
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
- # This file was generated by Appraisal
1
+ # This Gemfile is compatible with Ruby 2.5.0 or greater. To test with
2
+ # earlier Rubies, use the appropriate Gemfile from the ./gemfiles/ dir.
3
+ ruby '>= 2.5.0'
2
4
 
3
5
  source 'https://rubygems.org'
4
6
 
@@ -11,7 +13,7 @@ ENV['CURRENT_GEMFILE'] ||= __FILE__
11
13
 
12
14
  is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')
13
15
 
14
- GEMFILE_RAILS_VERSION = '~> 6.1.3'.freeze
16
+ GEMFILE_RAILS_VERSION = '~> 6.1.5'.freeze
15
17
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
16
18
  gem 'appraisal'
17
19
  gem 'jruby-openssl', :platform => :jruby
@@ -29,11 +31,7 @@ else
29
31
  gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw]
30
32
  end
31
33
 
32
- if RUBY_VERSION < '2.2.2'
33
- gem 'sidekiq', '~> 2.13.0'
34
- else
35
- gem 'sidekiq', '>= 2.13.0'
36
- end
34
+ gem 'sidekiq', '>= 6.4.0'
37
35
 
38
36
  platforms :rbx do
39
37
  gem 'minitest'
@@ -43,7 +41,6 @@ platforms :rbx do
43
41
  end
44
42
 
45
43
  gem 'capistrano', :require => false
46
- gem 'codacy-coverage'
47
44
  gem 'shoryuken'
48
45
  gem 'simplecov'
49
46
  gem 'sucker_punch', '~> 2.0'
@@ -69,7 +66,6 @@ else
69
66
  gem 'delayed_job', '~> 4.1', :require => false
70
67
  end
71
68
  gem 'generator_spec'
72
- gem 'girl_friday', '>= 0.11.1'
73
69
  gem 'redis'
74
70
  gem 'resque', '< 2.0.0'
75
71
  gem 'rubocop', '1.15.0', :require => false # pin specific version, update manually
data/README.md CHANGED
@@ -27,7 +27,7 @@ Version < 2.19.0 is compatible with Ruby >= 1.8.7.
27
27
 
28
28
  ### Ruby 2.6.0
29
29
 
30
- > WARNING: Ruby 2.6.0 introduced a new bug bug ([#15472 -
30
+ > WARNING: Ruby 2.6.0 introduced a new bug ([#15472 -
31
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
32
 
33
33
  > UPDATE: This bug is fixed in Ruby 2.6.1, and rollbar-gem has a safe workaround in version >= 2.19.0.
@@ -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(5);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdn.rollbar.com/rollbarjs/refs/tags/v2.22.0/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}}}}]);
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.25.0/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}}}}]);
@@ -28,7 +28,6 @@ platforms :rbx do
28
28
  end
29
29
 
30
30
  gem 'capistrano', :require => false
31
- gem 'codacy-coverage'
32
31
  gem 'rexml', '<= 3.2.4'
33
32
  gem 'shoryuken'
34
33
  gem 'simplecov', '<= 0.17.1'
@@ -27,7 +27,6 @@ platforms :rbx do
27
27
  end
28
28
 
29
29
  gem 'capistrano', :require => false
30
- gem 'codacy-coverage'
31
30
  gem 'rexml', '<= 3.2.4'
32
31
  gem 'shoryuken'
33
32
  gem 'simplecov', '<= 0.17.1'
@@ -29,7 +29,6 @@ platforms :rbx do
29
29
  end
30
30
 
31
31
  gem 'capistrano', :require => false
32
- gem 'codacy-coverage'
33
32
  gem 'rexml', '<= 3.2.4'
34
33
  gem 'shoryuken'
35
34
  gem 'simplecov', '<= 0.17.1'
@@ -29,7 +29,6 @@ platforms :rbx do
29
29
  end
30
30
 
31
31
  gem 'capistrano', :require => false
32
- gem 'codacy-coverage'
33
32
  gem 'json', '~> 2.0'
34
33
  gem 'shoryuken'
35
34
  gem 'simplecov', '<= 0.17.1'
@@ -26,7 +26,6 @@ platforms :rbx do
26
26
  end
27
27
 
28
28
  gem 'capistrano', :require => false
29
- gem 'codacy-coverage'
30
29
  gem 'shoryuken'
31
30
  gem 'simplecov', '<= 0.17.1'
32
31
  gem 'sucker_punch', '~> 2.0'
@@ -40,7 +40,6 @@ gem 'sinatra'
40
40
 
41
41
  gem 'nokogiri', '~> 1.6.0' if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('2.0')
42
42
 
43
- gem 'codacy-coverage'
44
43
  gem 'simplecov', '<= 0.17.1'
45
44
  gem 'sucker_punch', '~> 2.0'
46
45
  gem 'webmock', :require => false
@@ -29,7 +29,6 @@ platforms :rbx do
29
29
  end
30
30
 
31
31
  gem 'capistrano', :require => false
32
- gem 'codacy-coverage'
33
32
  gem 'simplecov', '<= 0.17.1'
34
33
  gem 'sucker_punch', '~> 2.0'
35
34
 
@@ -39,7 +38,6 @@ gem 'rack', '2.1.2' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
39
38
  gem 'database_cleaner', '~> 1.8.4'
40
39
  gem 'delayed_job', :require => false
41
40
  gem 'generator_spec'
42
- gem 'girl_friday', '>= 0.11.1'
43
41
  gem 'redis', '<= 3.3.5'
44
42
  gem 'resque'
45
43
  gem 'secure_headers', '~> 6.3.2', :require => false
@@ -29,7 +29,6 @@ platforms :rbx do
29
29
  end
30
30
 
31
31
  gem 'capistrano', :require => false
32
- gem 'codacy-coverage'
33
32
  gem 'simplecov', '<= 0.17.1'
34
33
  gem 'sucker_punch', '~> 2.0'
35
34
 
@@ -41,7 +40,6 @@ gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag => 'v2.0.8'
41
40
  gem 'database_cleaner', '~> 1.8.4'
42
41
  gem 'delayed_job', :require => false
43
42
  gem 'generator_spec'
44
- gem 'girl_friday', '>= 0.11.1'
45
43
  gem 'redis', '<= 3.3.5'
46
44
  gem 'resque'
47
45
  gem 'secure_headers', '~> 6.3.2', :require => false
@@ -17,7 +17,7 @@ gem 'rspec-support', '~> 3.8.0'
17
17
 
18
18
  gem 'rake'
19
19
 
20
- gem 'sidekiq', '>= 2.13.0'
20
+ gem 'sidekiq', '>= 6.4.0'
21
21
 
22
22
  platforms :rbx do
23
23
  gem 'minitest'
@@ -28,14 +28,12 @@ end
28
28
 
29
29
  gem 'sucker_punch', '~> 2.0'
30
30
 
31
- # We need last sinatra that uses rack 2.x
32
- gem 'sinatra', :git => 'https://github.com/sinatra/sinatra'
31
+ # We need last sinatra that uses rack 2.x and ruby 2.5.x
32
+ gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
33
33
 
34
- gem 'codacy-coverage'
35
34
  gem 'database_cleaner'
36
35
  gem 'delayed_job', :require => false
37
36
  gem 'generator_spec'
38
- gem 'girl_friday', '>= 0.11.1'
39
37
  gem 'redis'
40
38
  gem 'resque'
41
39
  gem 'secure_headers', '~> 6.3.2', :require => false
@@ -13,7 +13,7 @@ gem 'rspec-rails', '~> 4.0.2'
13
13
 
14
14
  gem 'rake'
15
15
 
16
- gem 'sidekiq', '>= 2.13.0'
16
+ gem 'sidekiq', '>= 6.4.0'
17
17
 
18
18
  platforms :rbx do
19
19
  gem 'minitest'
@@ -24,14 +24,12 @@ end
24
24
 
25
25
  gem 'sucker_punch', '~> 2.0'
26
26
 
27
- # We need last sinatra that uses rack 2.x
28
- gem 'sinatra', :git => 'https://github.com/sinatra/sinatra'
27
+ # We need last sinatra that uses rack 2.x and ruby 2.5.x
28
+ gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
29
29
 
30
- gem 'codacy-coverage'
31
30
  gem 'database_cleaner'
32
31
  gem 'delayed_job', '4.1.9', :require => false
33
32
  gem 'generator_spec'
34
- gem 'girl_friday', '>= 0.11.1'
35
33
  gem 'redis'
36
34
  gem 'resque'
37
35
  gem 'secure_headers', '~> 6.3.2', :require => false
@@ -6,14 +6,14 @@ is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == '
6
6
 
7
7
  gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
8
8
  gem 'jruby-openssl', :platform => :jruby
9
- gem 'rails', '~> 6.1.3'
9
+ gem 'rails', '~> 6.1.5'
10
10
  gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw]
11
11
 
12
12
  gem 'rspec-rails', '~> 4.0.2'
13
13
 
14
14
  gem 'rake'
15
15
 
16
- gem 'sidekiq', '>= 2.13.0'
16
+ gem 'sidekiq', '>= 6.4.0'
17
17
 
18
18
  platforms :rbx do
19
19
  gem 'minitest'
@@ -24,14 +24,12 @@ end
24
24
 
25
25
  gem 'sucker_punch', '~> 2.0'
26
26
 
27
- # We need last sinatra that uses rack 2.x
28
- gem 'sinatra', :git => 'https://github.com/sinatra/sinatra'
27
+ # We need last sinatra that uses rack 2.x and ruby 2.5.x
28
+ gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
29
29
 
30
- gem 'codacy-coverage'
31
30
  gem 'database_cleaner'
32
31
  gem 'delayed_job', '4.1.9', :require => false
33
32
  gem 'generator_spec'
34
- gem 'girl_friday', '>= 0.11.1'
35
33
  gem 'redis'
36
34
  gem 'resque'
37
35
  gem 'secure_headers', '~> 6.3.2', :require => false
@@ -0,0 +1,52 @@
1
+ require 'rubygems/version'
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')
6
+
7
+ gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
8
+ gem 'jruby-openssl', :platform => :jruby
9
+ gem 'rails', '~> 7.0.2.3'
10
+ gem 'sqlite3', '~> 1.4', :platform => [:ruby, :mswin, :mingw]
11
+
12
+ gem 'rspec-rails', '~> 4.0.2'
13
+
14
+ gem 'rake'
15
+
16
+ gem 'sidekiq', '>= 6.4.0'
17
+
18
+ platforms :rbx do
19
+ gem 'minitest'
20
+ gem 'racc'
21
+ gem 'rubinius-developer_tools'
22
+ gem 'rubysl', '~> 2.0' if RUBY_VERSION.start_with?('2')
23
+ end
24
+
25
+ gem 'sucker_punch', '~> 2.0'
26
+
27
+ # We need last sinatra that uses rack 2.x and ruby 2.5.x
28
+ gem 'sinatra', :git => 'https://github.com/sinatra/sinatra', :tag =>'v2.1.0'
29
+
30
+ gem 'database_cleaner'
31
+ gem 'delayed_job', '4.1.10', :require => false
32
+ gem 'generator_spec'
33
+ gem 'redis'
34
+ gem 'resque'
35
+ gem 'secure_headers', '~> 6.3.2', :require => false
36
+ gem 'simplecov'
37
+
38
+ unless is_jruby
39
+ # JRuby doesn't support fork, which is required for this test helper.
40
+ gem 'rspec-command'
41
+ end
42
+
43
+ gem 'mime-types'
44
+
45
+ gem 'webmock', :require => false
46
+
47
+ gem 'aws-sdk-sqs'
48
+ gem 'shoryuken'
49
+
50
+ gem 'capistrano', :require => false
51
+
52
+ gemspec :path => '../'
@@ -32,6 +32,8 @@ module Rollbar
32
32
  end
33
33
 
34
34
  def locals_for(frame)
35
+ return {} unless frame
36
+
35
37
  {}.tap do |hash|
36
38
  frame.local_variables.map do |var|
37
39
  hash[var] = prepare_value(frame.local_variable_get(var))
@@ -1,8 +1,12 @@
1
- # Allows a Ruby String to be used to create native Javascript objects
2
- # when calling JSON#generate.
1
+ # Allows a Ruby String to be used to pass native Javascript objects/functions
2
+ # when calling JSON#generate with a Rollbar::JSON::JsOptionsState instance.
3
3
  #
4
4
  # Example:
5
- # JSON.generate({ foo: Rollbar::JSON::Value.new('function(){ alert("bar") }') })
5
+ # JSON.generate(
6
+ # { foo: Rollbar::JSON::Value.new('function(){ alert("bar") }') },
7
+ # Rollbar::JSON::JsOptionsState.new
8
+ # )
9
+ #
6
10
  # => '{"foo":function(){ alert(\"bar\") }}'
7
11
  #
8
12
  # MUST use the Ruby JSON encoder, as in the example. The ActiveSupport encoder,
@@ -11,6 +15,8 @@
11
15
  #
12
16
  module Rollbar
13
17
  module JSON
18
+ class JsOptionsState < ::JSON::State; end
19
+
14
20
  class Value # :nodoc:
15
21
  attr_accessor :value
16
22
 
@@ -18,8 +24,12 @@ module Rollbar
18
24
  @value = value
19
25
  end
20
26
 
21
- def to_json(*_args)
22
- value
27
+ def to_json(opts = {})
28
+ # Return the raw value if this is from the js middleware
29
+ return value if opts.class == Rollbar::JSON::JsOptionsState
30
+
31
+ # Otherwise convert to a string
32
+ %Q["#{value}"]
23
33
  end
24
34
  end
25
35
  end
@@ -141,7 +141,7 @@ module Rollbar
141
141
 
142
142
  # MUST use the Ruby JSON encoder (JSON#generate).
143
143
  # See lib/rollbar/middleware/js/json_value
144
- json = ::JSON.generate(js_config)
144
+ json = ::JSON.generate(js_config, Rollbar::JSON::JsOptionsState.new)
145
145
 
146
146
  script_tag("var _rollbarConfig = #{json};", env)
147
147
  end
@@ -166,10 +166,9 @@ module Rollbar
166
166
  def script_tag(content, env)
167
167
  nonce = rails5_nonce(env) || secure_headers_nonce(env)
168
168
  script_tag_content = if nonce
169
- "\n<script type=\"text/javascript\" " \
170
- "nonce=\"#{nonce}\">#{content}</script>"
169
+ "\n<script nonce=\"#{nonce}\">#{content}</script>"
171
170
  else
172
- "\n<script type=\"text/javascript\">#{content}</script>"
171
+ "\n<script>#{content}</script>"
173
172
  end
174
173
 
175
174
  html_safe_if_needed(script_tag_content)
@@ -55,13 +55,21 @@ module Rollbar
55
55
 
56
56
  def frame(trace)
57
57
  {
58
- :binding => trace.binding,
58
+ :binding => binding(trace),
59
59
  :defined_class => trace.defined_class,
60
60
  :method_id => trace.method_id,
61
61
  :path => trace.path,
62
62
  :lineno => trace.lineno
63
63
  }
64
64
  end
65
+
66
+ def binding(trace)
67
+ trace.binding
68
+ rescue StandardError
69
+ # Ruby internals will raise if we're on a Fiber,
70
+ # since bindings aren't valid on Fibers.
71
+ nil
72
+ end
65
73
  end
66
74
  end
67
75
  end
@@ -50,7 +50,8 @@ module Rollbar
50
50
  def self.scrub_params(params)
51
51
  options = {
52
52
  :params => params,
53
- :config => Rollbar.configuration.scrub_fields
53
+ :config => Rollbar.configuration.scrub_fields,
54
+ :whitelist => Rollbar.configuration.scrub_whitelist
54
55
  }
55
56
 
56
57
  Rollbar::Scrubbers::Params.call(options)
@@ -214,7 +214,7 @@ module Rollbar
214
214
  return {} unless correct_method
215
215
  return {} unless json_request?(rack_req)
216
216
 
217
- raw_body = rack_req.body.read
217
+ raw_body = read_raw_body(rack_req.body)
218
218
  begin
219
219
  Rollbar::JSON.load(raw_body)
220
220
  rescue StandardError
@@ -222,8 +222,15 @@ module Rollbar
222
222
  end
223
223
  rescue StandardError
224
224
  {}
225
- ensure
226
- rack_req.body.rewind
225
+ end
226
+
227
+ def read_raw_body(body)
228
+ return {} unless body.respond_to?(:rewind)
229
+
230
+ body.rewind
231
+ raw_body = body.read
232
+ body.rewind
233
+ raw_body
227
234
  end
228
235
 
229
236
  def json_request?(rack_req)
@@ -1,3 +1,3 @@
1
1
  module Rollbar
2
- VERSION = '3.3.0'.freeze
2
+ VERSION = '3.3.2'.freeze
3
3
  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: 3.3.0
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rollbar, Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-27 00:00:00.000000000 Z
11
+ date: 2022-10-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Easy and powerful exception tracking for Ruby
14
14
  email:
@@ -48,6 +48,7 @@ files:
48
48
  - gemfiles/rails52.gemfile
49
49
  - gemfiles/rails60.gemfile
50
50
  - gemfiles/rails61.gemfile
51
+ - gemfiles/rails70.gemfile
51
52
  - lib/generators/rollbar/rollbar_generator.rb
52
53
  - lib/generators/rollbar/templates/initializer.erb
53
54
  - lib/rails/rollbar_runner.rb
@@ -146,7 +147,7 @@ metadata:
146
147
  bug_tracker_uri: https://github.com/rollbar/rollbar-gem/issues
147
148
  homepage_uri: https://rollbar.com/
148
149
  documentation_uri: https://docs.rollbar.com/docs/ruby
149
- post_install_message:
150
+ post_install_message:
150
151
  rdoc_options: []
151
152
  require_paths:
152
153
  - lib
@@ -162,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
163
  version: '0'
163
164
  requirements: []
164
165
  rubygems_version: 3.1.4
165
- signing_key:
166
+ signing_key:
166
167
  specification_version: 4
167
168
  summary: Reports exceptions to Rollbar
168
169
  test_files: []