rollbar 3.3.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c88b1bd8659724cc0d0351d4efb1a458ec8af8e466ddaf6a453e6acaa6da6bd9
4
- data.tar.gz: 7961e62c55a4f147644cd203ca279b188a7ec3061f15b7ce88943591ccf87e07
3
+ metadata.gz: 95b3c3bbbb1f542faf2c67fff212c6a4eb7f0c4986c827fa14b8a64f9c98046c
4
+ data.tar.gz: 101b72445564b0b8f656f9194ff9140d0551bc556b5444bf69ef4f8c8be67d61
5
5
  SHA512:
6
- metadata.gz: fce360ce571930f495008f786bbc41ed649a7ee9d0e1e23e81a5e050b9310dbf4fc50952f62236d23d5a27f8057efc4c030a321207357423526cffa38d07355c
7
- data.tar.gz: 759e0e90848534ea09cbfd6ffe866f2d75e314fc56e2bdd7dbd6a48a428691ae5c42d2ec5a158638ba74148456674b01d5450f5cea1198e3148bc6dd69ce545a
6
+ metadata.gz: 7f96379fee61b2b5dcef9f4f4c853c7602fba3ab51ec8e5ae8c95d1d034134e268cb2861842c68877b421c081979dec9b509d6b817e72bac26846d294f1b47f0
7
+ data.tar.gz: 7d0bd5d1c9ce8f0c0c1f49a1be17f99caa43bf8c15daab6b0674b423f5bdefe03cbc091b56657959a4575c0b1e64988e9f8155a1a8046e6724bb89c2e6fb8917
@@ -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,8 +66,7 @@ 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
- gem 'redis'
69
+ gem 'redis', '<= 4.8.0'
74
70
  gem 'resque', '< 2.0.0'
75
71
  gem 'rubocop', '1.15.0', :require => false # pin specific version, update manually
76
72
  gem 'rubocop-performance', :require => false
data/README.md CHANGED
@@ -1,13 +1,35 @@
1
- # Rollbar-gem
1
+ <p align="center">
2
+ <img alt="rollbar-logo" src="https://user-images.githubusercontent.com/3300063/207964480-54eda665-d6fe-4527-ba51-b0ab3f41f10b.png" />
3
+ </p>
4
+
5
+ <h1 align="center">Rollbar Ruby Gem</h1>
6
+
7
+ <p align="center">
8
+ <strong>Proactively discover, predict, and resolve errors in real-time with <a href="https://rollbar.com">Rollbar’s</a> error monitoring platform. <a href="https://rollbar.com/signup/">Start tracking errors today</a>!</strong>
9
+ </p>
10
+
11
+
2
12
  ![Build Status](https://github.com/rollbar/rollbar-gem/workflows/Rollbar-gem%20CI/badge.svg?tag=latest)
3
13
  [![Gem Version](https://badge.fury.io/rb/rollbar.svg)](http://badge.fury.io/rb/rollbar)
4
14
  [![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
15
 
6
16
 
17
+ ---
18
+
7
19
  [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.
8
20
 
9
21
  Rollbar-gem is the SDK for Ruby apps and includes support for apps using Rails, Sinatra, Rack, plain Ruby, and other frameworks.
10
22
 
23
+
24
+ ## Key benefits of using Rollbar Ruby Gem are:
25
+
26
+ - **Frameworks:** Rollbar Ruby Gem supports popular Ruby frameworks such as <a href="https://docs.rollbar.com/docs/rails">Rails</a>, <a href="https://docs.rollbar.com/docs/sinatra">Sinatra</a>, <a href="https://docs.rollbar.com/docs/grape">Grape</a> and more.
27
+ - **Integrations:** Rollbar Ruby has integrations for <a href="https://docs.rollbar.com/docs/resque-integration">Resque</a>, <a href="https://docs.rollbar.com/docs/activejob-integration">ActiveJob</a>, <a href="https://docs.rollbar.com/docs/using-with-rollbar-agent">rollbar-agent</a>, <a href="https://docs.rollbar.com/docs/sidekiq-integration">Sidekiq</a> and more!
28
+ - **Automatic error grouping:** Rollbar aggregates Occurrences caused by the same error into Items that represent application issues. <a href="https://docs.rollbar.com/docs/grouping-occurrences">Learn more about reducing log noise</a>.
29
+ - **Advanced search:** Filter items by many different properties. <a href="https://docs.rollbar.com/docs/search-items">Learn more about search</a>.
30
+ - **Customizable notifications:** Rollbar supports several messaging and incident management tools where your team can get notified about errors and important events by real-time alerts. <a href="https://docs.rollbar.com/docs/notifications">Learn more about Rollbar notifications</a>.
31
+
32
+
11
33
  ## Setup Instructions
12
34
 
13
35
  1. [Sign up for a Rollbar account](https://rollbar.com/signup)
@@ -27,7 +49,7 @@ Version < 2.19.0 is compatible with Ruby >= 1.8.7.
27
49
 
28
50
  ### Ruby 2.6.0
29
51
 
30
- > WARNING: Ruby 2.6.0 introduced a new bug bug ([#15472 -
52
+ > WARNING: Ruby 2.6.0 introduced a new bug ([#15472 -
31
53
  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
54
 
33
55
  > 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.26.1/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||function(r){return!("object"!=typeof r||void 0!==r.page&&!r.page)}(a))&&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,15 +28,13 @@ 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
- gem 'redis'
37
+ gem 'redis', '<= 4.8.0'
40
38
  gem 'resque'
41
39
  gem 'secure_headers', '~> 6.3.2', :require => false
42
40
  gem 'simplecov', '<= 0.17.1'
@@ -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,15 +24,13 @@ 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
- gem 'redis'
33
+ gem 'redis', '<= 4.8.0'
36
34
  gem 'resque'
37
35
  gem 'secure_headers', '~> 6.3.2', :require => false
38
36
  gem 'simplecov'
@@ -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,15 +24,13 @@ 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
- gem 'redis'
33
+ gem 'redis', '<= 4.8.0'
36
34
  gem 'resque'
37
35
  gem 'secure_headers', '~> 6.3.2', :require => false
38
36
  gem 'simplecov'
@@ -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', '<= 4.8.0'
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 => '../'
@@ -11,19 +11,6 @@ APP_PATH = File.expand_path(
11
11
 
12
12
  module Rails
13
13
  class RollbarRunner
14
- class GemResolver
15
- def railties_gem
16
- Gem::Specification.find_by_name('railties')
17
- end
18
- end
19
-
20
- class LegacyGemResolver
21
- def railties_gem
22
- searcher = Gem::GemPathSearcher.new
23
- searcher.find('rails')
24
- end
25
- end
26
-
27
14
  attr_reader :command
28
15
 
29
16
  def initialize
@@ -75,12 +62,7 @@ module Rails
75
62
  end
76
63
 
77
64
  def railties_gem
78
- resolver_class = if Gem::Specification.respond_to?(:find_by_name)
79
- GemResolver
80
- else
81
- LegacyGemResolver
82
- end
83
- gem = resolver_class.new.railties_gem
65
+ gem = Gem::Specification.find_by_name('railties')
84
66
 
85
67
  abort 'railties gem not found' unless gem
86
68
 
@@ -324,7 +324,7 @@ module Rollbar
324
324
  def send_extra_frame_data=(value)
325
325
  unless SEND_EXTRA_FRAME_DATA_OPTIONS.include?(value)
326
326
  logger.warning(
327
- "Wrong 'send_extra_frame_data' value, :none, :app or :full is expected"
327
+ "Wrong 'send_extra_frame_data' value, :none, :app or :all is expected"
328
328
  )
329
329
 
330
330
  return
@@ -5,13 +5,8 @@ module Rollbar
5
5
  end
6
6
 
7
7
  def self.setup
8
- if String.instance_methods.include?(:encode)
9
- require 'rollbar/encoding/encoder'
10
- self.encoding_class = Rollbar::Encoding::Encoder
11
- else
12
- require 'rollbar/encoding/legacy_encoder'
13
- self.encoding_class = Rollbar::Encoding::LegacyEncoder
14
- end
8
+ require 'rollbar/encoding/encoder'
9
+ self.encoding_class = Rollbar::Encoding::Encoder
15
10
  end
16
11
 
17
12
  def self.encode(object)
@@ -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
@@ -134,6 +134,7 @@ module Rollbar
134
134
 
135
135
  def config_js_tag(env)
136
136
  require 'json'
137
+ require 'rollbar/middleware/js/json_value'
137
138
 
138
139
  js_config = Rollbar::Util.deep_copy(config[:options])
139
140
 
@@ -141,7 +142,7 @@ module Rollbar
141
142
 
142
143
  # MUST use the Ruby JSON encoder (JSON#generate).
143
144
  # See lib/rollbar/middleware/js/json_value
144
- json = ::JSON.generate(js_config)
145
+ json = ::JSON.generate(js_config, Rollbar::JSON::JsOptionsState.new)
145
146
 
146
147
  script_tag("var _rollbarConfig = #{json};", env)
147
148
  end
@@ -166,10 +167,9 @@ module Rollbar
166
167
  def script_tag(content, env)
167
168
  nonce = rails5_nonce(env) || secure_headers_nonce(env)
168
169
  script_tag_content = if nonce
169
- "\n<script type=\"text/javascript\" " \
170
- "nonce=\"#{nonce}\">#{content}</script>"
170
+ "\n<script nonce=\"#{nonce}\">#{content}</script>"
171
171
  else
172
- "\n<script type=\"text/javascript\">#{content}</script>"
172
+ "\n<script>#{content}</script>"
173
173
  end
174
174
 
175
175
  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
@@ -27,5 +27,9 @@ if defined?(ActiveSupport) && ActiveSupport.respond_to?(:on_load)
27
27
  ActionMailer::DeliveryJob.send(:include,
28
28
  Rollbar::ActiveJob)
29
29
  end
30
+ # Rails >= 6.0
31
+ if defined?(ActionMailer::MailDeliveryJob)
32
+ ActionMailer::MailDeliveryJob.send(:include, Rollbar::ActiveJob)
33
+ end
30
34
  end
31
35
  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.4.0'.freeze
3
3
  end
data/rollbar.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
7
7
 
8
8
  gem.authors = ['Rollbar, Inc.']
9
9
  gem.email = ['support@rollbar.com']
10
- gem.description = 'Easy and powerful exception tracking for Ruby'
10
+ gem.description = "Track and debug errors in your Ruby applications with ease using Rollbar. With this gem, you can easily monitor and report on exceptions and other errors in your code, helping you identify and fix issues more quickly. Rollbar's intuitive interface and advanced error tracking features make it the perfect tool for ensuring the stability and reliability of your Ruby applications."
11
11
  gem.executables = ['rollbar-rails-runner']
12
12
  gem.summary = 'Reports exceptions to Rollbar'
13
13
  gem.homepage = 'https://rollbar.com'
metadata CHANGED
@@ -1,16 +1,20 @@
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.4.0
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: 2023-01-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Easy and powerful exception tracking for Ruby
13
+ description: Track and debug errors in your Ruby applications with ease using Rollbar.
14
+ With this gem, you can easily monitor and report on exceptions and other errors
15
+ in your code, helping you identify and fix issues more quickly. Rollbar's intuitive
16
+ interface and advanced error tracking features make it the perfect tool for ensuring
17
+ the stability and reliability of your Ruby applications.
14
18
  email:
15
19
  - support@rollbar.com
16
20
  executables:
@@ -48,6 +52,7 @@ files:
48
52
  - gemfiles/rails52.gemfile
49
53
  - gemfiles/rails60.gemfile
50
54
  - gemfiles/rails61.gemfile
55
+ - gemfiles/rails70.gemfile
51
56
  - lib/generators/rollbar/rollbar_generator.rb
52
57
  - lib/generators/rollbar/templates/initializer.erb
53
58
  - lib/rails/rollbar_runner.rb
@@ -67,7 +72,6 @@ files:
67
72
  - lib/rollbar/deploy.rb
68
73
  - lib/rollbar/encoding.rb
69
74
  - lib/rollbar/encoding/encoder.rb
70
- - lib/rollbar/encoding/legacy_encoder.rb
71
75
  - lib/rollbar/exception_reporter.rb
72
76
  - lib/rollbar/exceptions.rb
73
77
  - lib/rollbar/item.rb
@@ -146,7 +150,7 @@ metadata:
146
150
  bug_tracker_uri: https://github.com/rollbar/rollbar-gem/issues
147
151
  homepage_uri: https://rollbar.com/
148
152
  documentation_uri: https://docs.rollbar.com/docs/ruby
149
- post_install_message:
153
+ post_install_message:
150
154
  rdoc_options: []
151
155
  require_paths:
152
156
  - lib
@@ -162,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
166
  version: '0'
163
167
  requirements: []
164
168
  rubygems_version: 3.1.4
165
- signing_key:
169
+ signing_key:
166
170
  specification_version: 4
167
171
  summary: Reports exceptions to Rollbar
168
172
  test_files: []
@@ -1,20 +0,0 @@
1
- require 'iconv'
2
-
3
- module Rollbar
4
- module Encoding
5
- class LegacyEncoder
6
- attr_accessor :object
7
-
8
- def initialize(object)
9
- @object = object
10
- end
11
-
12
- def encode
13
- value = object.to_s
14
- encoded_value = ::Iconv.conv('UTF-8//IGNORE', 'UTF-8', value)
15
-
16
- object.is_a?(Symbol) ? encoded_value.to_sym : encoded_value
17
- end
18
- end
19
- end
20
- end