rollbar 2.21.0 → 2.22.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/rollbar.snippet.js +1 -1
- data/lib/rollbar/configuration.rb +35 -1
- data/lib/rollbar/item.rb +22 -1
- data/lib/rollbar/notifier.rb +3 -3
- data/lib/rollbar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c56a90107593b66c2be899fd4f36abe3ad657abcd0e2d822964efbc8e47efdbb
|
4
|
+
data.tar.gz: cd95d87f45d3e65f3dc499c9be88c3c18b84ccd359eda34ed2ab88e941909754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6fe31a226014d67e1225234e408030b1e9bab112973e3a312607e26c71c98e6c64d56d7ea2163e0d1cfdd5af3755c384e15c6e11c3166f9478b384f4c0a512f
|
7
|
+
data.tar.gz: 12c63a9346dc60827b7b5765b6e63ce9d5c814fdb90c0e685952e4751669bb0f0770344830d625070cac6d656958f6bbd2862522cd7d51d1e0cae039bfd0efb5
|
data/data/rollbar.snippet.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){var n=o(1),t=o(4);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.
|
1
|
+
!function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){var n=o(1),t=o(4);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.12.3/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){var n=o(2);function t(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var a=0;function l(r,e){this.options=r,this._rollbarOldOnError=null;var o=a++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var i=o(3),s=function(r,e){return new l(r,e)},d=function(r){return new i(s,r)};function c(r){return t(function(){var e=Array.prototype.slice.call(arguments,0),o={shim:this,method:r,args:e,ts:new Date};window._rollbarShims[this.shimId()].messages.push(o)})}l.prototype.loadFull=function(r,e,o,n,a){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=t(function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,t,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(t=n.args||[],i=0;i<t.length;++i)if("function"==typeof(l=t[i])){l(e);break}}"function"==typeof a&&a(e)}()}}),d.insertBefore(i,s)},l.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var p="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),u=0;u<p.length;++u)l.prototype[p[u]]=c(p[u]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var a=new d(e);return t(function(){e.captureUncaught&&(a._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,a,!0),e.wrapGlobalEventHandlers&&n.wrapGlobals(r,a,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,a,!0);var t=e.autoInstrument;return!1!==e.enabled&&(void 0===t||!0===t||"object"==typeof t&&t.network)&&r.addEventListener&&(r.addEventListener("load",a.captureLoad.bind(a)),r.addEventListener("DOMContentLoaded",a.captureDomContentLoaded.bind(a))),r[o]=a,a})()}},Rollbar:d}},function(r,e){function o(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var n;if("function"==typeof e._rollbarOldOnError)n=e._rollbarOldOnError;else if(r.onerror){for(n=r.onerror;n._rollbarOldOnError;)n=n._rollbarOldOnError;e._rollbarOldOnError=n}e.handleAnonymousErrors();var t=function(){var o=Array.prototype.slice.call(arguments,0);!function(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null);var t=e.handleUncaughtException.apply(e,n);o&&o.apply(r,n),"anonymous"===t&&(e.anonymousErrorsPending+=1)}(r,e,n,o)};o&&(t._rollbarOldOnError=n),r.onerror=t}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}},wrapGlobals:function(r,e,n){if(r){var t,a,l="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(t=0;t<l.length;++t)r[a=l[t]]&&r[a].prototype&&o(e,r[a].prototype,n)}}}},function(r,e){function o(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(o.prototype)}o.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=o},function(r,e){r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
|
@@ -68,6 +68,7 @@ module Rollbar
|
|
68
68
|
attr_accessor :log_payload
|
69
69
|
|
70
70
|
attr_reader :project_gem_paths
|
71
|
+
attr_accessor :configured_options
|
71
72
|
|
72
73
|
alias safely? safely
|
73
74
|
|
@@ -114,7 +115,7 @@ module Rollbar
|
|
114
115
|
@locals = {}
|
115
116
|
@scrub_fields = [:passwd, :password, :password_confirmation, :secret,
|
116
117
|
:confirm_password, :password_confirmation, :secret_token,
|
117
|
-
:api_key, :access_token, :session_id]
|
118
|
+
:api_key, :access_token, :accessToken, :session_id]
|
118
119
|
@scrub_user = true
|
119
120
|
@scrub_password = true
|
120
121
|
@randomize_scrub_length = true
|
@@ -142,6 +143,8 @@ module Rollbar
|
|
142
143
|
:on_error_response => nil, # params: response
|
143
144
|
:on_report_internal_error => nil # params: exception
|
144
145
|
}
|
146
|
+
|
147
|
+
@configured_options = ConfiguredOptions.new(self)
|
145
148
|
end
|
146
149
|
|
147
150
|
def initialize_copy(orig)
|
@@ -153,6 +156,15 @@ module Rollbar
|
|
153
156
|
end
|
154
157
|
end
|
155
158
|
|
159
|
+
def wrapped_clone
|
160
|
+
original_clone.tap do |new_config|
|
161
|
+
new_config.configured_options = ConfiguredOptions.new(new_config)
|
162
|
+
new_config.configured_options.configured = configured_options.configured
|
163
|
+
end
|
164
|
+
end
|
165
|
+
alias original_clone clone
|
166
|
+
alias clone wrapped_clone
|
167
|
+
|
156
168
|
def merge(options)
|
157
169
|
new_configuration = clone
|
158
170
|
new_configuration.merge!(options)
|
@@ -303,4 +315,26 @@ module Rollbar
|
|
303
315
|
hook(symbol).call(*args) if hook(symbol).is_a?(Proc)
|
304
316
|
end
|
305
317
|
end
|
318
|
+
|
319
|
+
class ConfiguredOptions
|
320
|
+
attr_accessor :configuration, :configured
|
321
|
+
|
322
|
+
def initialize(configuration)
|
323
|
+
@configuration = configuration
|
324
|
+
@configured = {}
|
325
|
+
end
|
326
|
+
|
327
|
+
def method_missing(method, *args, &block)
|
328
|
+
return super unless configuration.respond_to?(method)
|
329
|
+
|
330
|
+
method_string = method.to_s
|
331
|
+
configured[method_string.chomp('=').to_sym] = args.first if method_string.end_with?('=')
|
332
|
+
|
333
|
+
configuration.send(method, *args, &block)
|
334
|
+
end
|
335
|
+
|
336
|
+
def respond_to_missing?(method)
|
337
|
+
configuration.respond_to?(method) || super
|
338
|
+
end
|
339
|
+
end
|
306
340
|
end
|
data/lib/rollbar/item.rb
CHANGED
@@ -84,7 +84,8 @@ module Rollbar
|
|
84
84
|
:server => server_data,
|
85
85
|
:notifier => {
|
86
86
|
:name => 'rollbar-gem',
|
87
|
-
:version => VERSION
|
87
|
+
:version => VERSION,
|
88
|
+
:configured_options => configured_options
|
88
89
|
},
|
89
90
|
:body => build_body
|
90
91
|
}
|
@@ -102,6 +103,26 @@ module Rollbar
|
|
102
103
|
data
|
103
104
|
end
|
104
105
|
|
106
|
+
def configured_options
|
107
|
+
if Gem.loaded_specs['activesupport'] && Gem.loaded_specs['activesupport'].version < Gem::Version.new('4.1')
|
108
|
+
# There are too many types that crash ActiveSupport JSON serialization, and not worth
|
109
|
+
# the risk just to send this diagnostic object. In versions < 4.1, ActiveSupport hooks
|
110
|
+
# Ruby's JSON.generate so deeply there's no workaround.
|
111
|
+
'not serialized in ActiveSupport < 4.1'
|
112
|
+
elsif configuration.use_async
|
113
|
+
# Currently serialization is performed by each handler, and this invariably
|
114
|
+
# means it is actually performed by ActiveSupport.
|
115
|
+
#
|
116
|
+
# TODO: Since serialization must be done prior to scheduling the job,
|
117
|
+
# it should at least be done by rollbar-gem itself. Much work has been done
|
118
|
+
# to avoid the bugs in ActiveSupport JSON. The async handlers are currently
|
119
|
+
# still subject to all those knnown issues.
|
120
|
+
'not serialized for async/delayed handlers'
|
121
|
+
else
|
122
|
+
scrub(configuration.configured_options.configured)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
105
126
|
def dump
|
106
127
|
# Ensure all keys are strings since we can receive the payload inline or
|
107
128
|
# from an async handler job, which can be serialized.
|
data/lib/rollbar/notifier.rb
CHANGED
@@ -42,21 +42,21 @@ module Rollbar
|
|
42
42
|
# Similar to configure below, but used only internally within the gem
|
43
43
|
# to configure it without initializing any of the third party hooks
|
44
44
|
def preconfigure
|
45
|
-
yield(configuration)
|
45
|
+
yield(configuration.configured_options)
|
46
46
|
end
|
47
47
|
|
48
48
|
# Configures the notifier instance
|
49
49
|
def configure
|
50
50
|
configuration.enabled = true if configuration.enabled.nil?
|
51
51
|
|
52
|
-
yield(configuration)
|
52
|
+
yield(configuration.configured_options)
|
53
53
|
end
|
54
54
|
|
55
55
|
def reconfigure
|
56
56
|
self.configuration = Configuration.new
|
57
57
|
configuration.enabled = true
|
58
58
|
|
59
|
-
yield(configuration)
|
59
|
+
yield(configuration.configured_options)
|
60
60
|
end
|
61
61
|
|
62
62
|
def unconfigure
|
data/lib/rollbar/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rollbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.22.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rollbar, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Easy and powerful exception tracking for Ruby
|
14
14
|
email:
|