squash_javascript 1.0.0

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.
@@ -0,0 +1,24 @@
1
+ (function(){var h,k={}.hasOwnProperty,f=[].slice,e="undefined"!==typeof exports&&null!==exports?exports:this,j=function(){},v;v=void 0;j.instance=function(){return null!=v?v:v=new h};e.SquashJavascript=j;var e=function(){TraceKit.report.subscribe(function(b){return SquashJavascript.instance().report(b)})},r,u,C,l;e.prototype.configure=function(b){var d,c,a;this.options||(this.options={disabled:!1,notifyPath:"/api/1.0/notify",transmitTimeout:15E3,ignoredExceptionClasses:[],ignoredExceptionMessages:{}});
2
+ a=[];for(d in b)k.call(b,d)&&(c=b[d],a.push(this.options[d]=c));return a};e.prototype.notify=function(b){if(b instanceof Error)return TraceKit.report(b);throw b;};e.prototype.report=function(b,d){var c,a,g,n,z,A,p,i;try{if(null!=(n=this.options)&&n.disabled)return!1;if(!(null!=(z=this.options)&&z.APIKey)||!(null!=(A=this.options)&&A.environment)||!(null!=(p=this.options)&&p.revision)||!(null!=(i=this.options)&&i.APIHost))return console.error("Missing required Squash configuration keys"),!1;if(this.shouldIgnoreError(b)||
3
+ !b.stack)return!1;a=d||{};a.api_key=this.options.APIKey;a.environment=this.options.environment;a.client="javascript";a.revision=this.options.revision;a.class_name=b.type||b.name;!b.name&&(g=b.message.match(/^(Uncaught )?(\w+): (.+)/))?(a.class_name=g[2],a.message=g[3]):a.message=b.message;null==a.class_name&&(a.class_name="Error");a.backtraces=C(b.stack);a.capture_method=b.mode;a.occurred_at=r(new Date);a.schema=window.location.protocol.replace(/:$/,"");a.host=window.location.hostname;0<window.location.port.length&&
4
+ (a.port=window.location.port);a.path=window.location.pathname;a.query=window.location.search;""!==window.location.hash&&(a.fragment=window.location.hash);a.user_agent=navigator.userAgent;a.screen_width=screen.width;a.screen_height=screen.height;a.window_width=window.innerWidth;a.window_height=window.innerHeight;a.color_depth=screen.colorDepth;c=JSON.stringify(a);this.HTTPTransmit(this.options.APIHost+this.options.notifyPath,[["Content-Type","application/json"]],c);return!0}catch(e){return console.error("Error while trying to notify Squash:",
5
+ e.stack),console.error("-- original error:",b)}};e.prototype.addUserData=function(b,d){try{return d()}catch(c){throw null==c._squash_user_data&&(c._squash_user_data={}),l(c._squash_user_data,b),c;}};e.prototype.addingUserData=function(b,d){return function(){var c;c=1<=arguments.length?f.call(arguments,0):[];return SquashJavascript.instance().addUserData(b,function(){return d.apply(null,c)})}};e.prototype.ignoreExceptions=function(){var b,d;d=2<=arguments.length?f.call(arguments,0,b=arguments.length-
6
+ 1):(b=0,[]);b=arguments[b++];try{return b()}catch(c){throw c._squash_ignored_exceptions=(c._squash_ignored_exceptions||[]).concat(d),c;}};e.prototype.ignoringExceptions=function(){var b,d,c;d=2<=arguments.length?f.call(arguments,0,c=arguments.length-1):(c=0,[]);b=arguments[c++];return function(){var a,g;a=1<=arguments.length?f.call(arguments,0):[];return(g=SquashJavascript.instance()).ignoreExceptions.apply(g,f.call(d).concat([function(){return b.apply(null,a)}]))}};e.prototype.HTTPTransmit=function(b,
7
+ d,c){var a,g,n;a=new XMLHttpRequest;a.timeout=this.options.transmitTimeout;a.open("POST",b,!0);g=0;for(n=d.length;g<n;g++)b=d[g],a.setRequestHeader(b[0],b[1]);a.send(c);return a};e.prototype.shouldIgnoreError=function(b){var d;d=this.options.ignoredExceptionClasses.concat(b._squash_ignored_exceptions||[]);return u(d,function(c){return b.name===c})?!0:u(this.options.ignoredExceptionMessages,function(c,a){return b.name===c?u(a,function(a){return b.message.match(a)}):!1})};C=function(b){var d,c,a,g,
8
+ n;d=[];g=0;for(n=b.length;g<n;g++)a=b[g],(c=a.context)&&u(c,function(a){return 200<a.length})&&(c=null),d.push(["_JS_ASSET_",a.url,a.line,a.column,a.func,c]);return[["Active Thread",!0,d]]};r=function(b){var d;d=function(b){return 10>b?"0"+b:b};return""+b.getUTCFullYear()+"-"+d(b.getUTCMonth()+1)+"-"+d(b.getUTCDate())+"T"+d(b.getUTCHours())+":"+d(b.getUTCMinutes())+":"+d(b.getUTCSeconds())+"Z"};u=function(b,d){var c,a,g;if(b instanceof Array){a=0;for(g=b.length;a<g;a++)if(c=b[a],d(c))return!0}else for(c in b)if(k.call(b,
9
+ c)&&(a=b[c],d(c,a)))return!0;return!1};l=function(b,d){var c,a,g;g=[];for(c in d)k.call(d,c)&&(a=d[c],g.push(b[c]=a));return g};h=e}).call(this);var TraceKit={};
10
+ TraceKit.report=function(){function h(e){var j=null,h;for(h in f)if(f.hasOwnProperty(h))try{f[h](e)}catch(l){j=l}if(j)throw j;}function k(r){if(j){if(e===r)return;var f=j;e=j=null;h(f)}var k=TraceKit.computeStackTrace(r);j=k;e=r;window.setTimeout(function(){e===r&&(e=j=null,h(k))},k.incomplete?2E3:0);throw r;}var f=[],e=null,j=null,v=window.onerror;window.onerror=function(r,f,k){var l=null;j?(TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(j,f,k,r),l=j,e=j=null):(l={url:f,line:k},l.func=
11
+ TraceKit.computeStackTrace.guessFunctionName(l.url,l.line),l.context=TraceKit.computeStackTrace.gatherContext(l.url,l.line),l={mode:"onerror",message:r,stack:[l]});h(l);return v?v.apply(this,arguments):!1};k.subscribe=function(e){f.push(e)};k.unsubscribe=function(e){for(var j=f.length-1;0<=j;--j)f[j]===e&&f.splice(j,1)};return k}();
12
+ TraceKit.computeStackTrace=function(){function h(a){if(!c.hasOwnProperty(a)){var g,b=a.split("/");if(2<b.length&&b[2]===document.domain)try{void 0===XMLHttpRequest&&(XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(g){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(b){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(n){}throw Error("No XHR.");});var z=new XMLHttpRequest;z.open("GET",a,!1);
13
+ z.send("");g=z.responseText}catch(d){g=""}else g=[];c[a]=g.length?g.split("\n"):[]}return c[a]}function k(a,g){var b=/function ([^(]*)\(([^)]*)\)/,z=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,c="",d=h(a),i;if(!d.length)return"?";for(var e=0;10>e;++e)if(c=d[g-e]+c,void 0!==c&&((i=z.exec(c))||(i=b.exec(c))))return i[1];return"?"}function f(a,g){var b=h(a),c=[],d=!1;if(!b.length)return null;for(var g=g-1,e=g-2,i=g+2;e<i;++e)c.push(b[e]),void 0!==b[e]&&(d=!0);return d?c:null}function e(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,
14
+ "\\$&")}function j(a){return e(a).replace("<","(?:<|&lt;)").replace(">","(?:>|&gt;)").replace("&","(?:&|&amp;)").replace('"','(?:"|&quot;)').replace(/\s+/g,"\\s+")}function v(a,b){for(var n,c,d=0,e=b.length;d<e;++d)if((n=h(b[d])).length)if(n=n.join("\n"),c=a.exec(n))return{url:b[d],line:n.substring(0,c.index).split("\n").length,column:c.index-n.lastIndexOf("\n",c.index)-1};return null}function r(a,b,c){var b=h(b),a=RegExp("\\b"+e(a)+"\\b"),d,c=c-1;return b&&b.length>c&&(d=a.exec(b[c]))?d.index:null}
15
+ function u(a){var b=[window.location.href],c=document.getElementsByTagName("script"),a=""+a,d;for(d=0;d<c.length;++d){var f=c[d];f.src&&b.push(f.src)}(c=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/.exec(a))?(d=c[1]?"\\s+"+c[1]:"",f=c[2].split(",").join("\\s*,\\s*"),c=e(c[3]).replace(/;$/,";?").replace(/\s+/g,"\\s+"),d=RegExp("function"+d+"\\s*\\(\\s*"+f+"\\s*\\)\\s*{\\s*"+c+"\\s*}")):d=RegExp(e(a).replace(/\s+/g,"\\s+"));if(d=v(d,b))return d;if(c=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/.exec(a)){a=
16
+ c[1];c=j(c[2]);d=RegExp("on"+a+"=[\\'\"]\\s*"+c+"\\s*[\\'\"]","i");if(d=v(d,b[0]))return d;d=RegExp(c);if(d=v(d,b))return d}return null}function C(a,b,c,d){b={url:b,line:c};if(b.url&&b.line){a.incomplete=!1;b.func||(b.func=k(b.url,b.line));b.context||(b.context=f(b.url,b.line));if(d=/ '([^']+)' /.exec(d))b.column=r(d[1],b.url,b.line);if(0<a.stack.length&&a.stack[0].url===b.url){if(a.stack[0].line===b.line)return!1;if(!a.stack[0].line&&a.stack[0].func===b.func)return a.stack[0].line=b.line,a.stack[0].context=
17
+ b.context,!1}a.stack.unshift(b);return a.partial=!0}a.incomplete=!0;return!1}function l(a,c){for(var d=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,e=[],j={},f,i,h=arguments.callee.caller;h;h=h.caller)if(!(h===b||h===TraceKit.report)){i={url:null,func:"?",line:null,column:null};if(h.name)i.func=h.name;else if(f=d.exec(h.toString()))i.func=f[1];if(f=u(h)){i.url=f.url;i.line=f.line;"?"===i.func&&(i.func=k(i.url,i.line));var l=/ '([^']+)' /.exec(a.message||a.description);l&&(i.column=
18
+ r(l[1],f.url,f.line))}j[""+h]&&(i.recursion=!0);e.push(i)}c&&e.splice(0,c);d={mode:"callers",name:a.name,message:a.message,stack:e};C(d,a.sourceURL||a.fileName,a.line||a.lineNumber,a.message||a.description);return d}function b(a,b){var c=null,b=void 0===b?0:+b;try{for(var e=/ line (\d+), column (\d+) in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,A=a.stacktrace.split("\n"),p=[],i,u=0,C=A.length;u<C;u+=2)if(i=e.exec(A[u])){var w={line:+i[1],column:+i[2],func:i[3]||i[4],args:i[5]?
19
+ i[5].split(","):[],url:i[6]};!w.func&&w.line&&(w.func=k(w.url,w.line));if(w.line)try{w.context=f(w.url,w.line)}catch(T){}w.context||(w.context=[A[u+1]]);p.push(w)}c=p.length?{mode:"stacktrace",name:a.name,message:a.message,stack:p}:null;if(c)return c}catch(L){if(d)throw L;}try{if(a.stack){var e=/^\s*at (\S+) \(((?:file|http):.*?):(\d+)(?::(\d+))?\)\s*$/i,A=/^\s*(\S*)(?:\((.*?)\))?@((?:file|http).*?):(\d+)(?::(\d+))?\s*$/i,E=a.stack.split("\n"),p=[],q,s,D=/^(.*) is undefined$/.exec(a.message);i=0;
20
+ for(var G=E.length;i<G;++i){if(q=A.exec(E[i]))s={url:q[3],func:q[1],args:q[2]?q[2].split(","):"",line:+q[4],column:q[5]?+q[5]:null};else if(q=e.exec(E[i]))s={url:q[2],func:q[1],line:+q[3],column:q[4]?+q[4]:null};else continue;!s.func&&s.line&&(s.func=k(s.url,s.line));s.line&&(s.context=f(s.url,s.line));p.push(s)}p[0]&&(p[0].line&&!p[0].column&&D)&&(p[0].column=r(D[1],p[0].url,p[0].line));c=p.length?{mode:"stack",name:a.name,message:a.message,stack:p}:null}else c=null;if(c)return c}catch(M){if(d)throw M;
21
+ }try{var y=a.message.split("\n");if(4>y.length)c=null;else{E=/^\s*Line (\d+) of linked script ((?:file|http)\S+)(?:: in function (\S+))?\s*$/i;q=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|http)\S+)(?:: in function (\S+))?\s*$/i;s=/^\s*Line (\d+) of function script\s*$/i;var D=[],m=document.getElementsByTagName("script"),G=[],x,t,H,B;for(t in m)m.hasOwnProperty(t)&&!m[t].src&&G.push(m[t]);t=2;for(H=y.length;t<H;t+=2){m=null;if(x=E.exec(y[t]))m={url:x[2],func:x[3],line:+x[1]};else if(x=q.exec(y[t])){var m=
22
+ {url:x[3],func:x[4]},N=+x[1],I=G[x[2]-1];if(I&&(B=h(m.url))){B=B.join("\n");var J=B.indexOf(I.innerText);0<=J&&(m.line=N+B.substring(0,J).split("\n").length)}}else if(x=s.exec(y[t])){var K=window.location.href.replace(/#.*$/,""),O=x[1],P=RegExp(j(y[t+1]));B=v(P,[K]);m={url:K,line:B?B.line:O,func:""}}if(m){m.func||(m.func=k(m.url,m.line));var F=f(m.url,m.line),Q=F?F[Math.floor(F.length/2)]:null;m.context=F&&Q.replace(/^\s*/,"")===y[t+1].replace(/^\s*/,"")?F:[y[t+1]];D.push(m)}}c=D.length?{mode:"multiline",
23
+ name:a.name,message:y[0],stack:D}:null}if(c)return c}catch(R){if(d)throw R;}try{if(c=l(a,b+1))return c}catch(S){if(d)throw S;}return{mode:"failed"}}var d=!1,c={};b.augmentStackTraceWithInitialElement=C;b.guessFunctionName=k;b.gatherContext=f;b.ofCaller=function(a){a=(void 0===a?0:+a)+1;try{0()}catch(c){return b(c,a+1)}return null};return b}();
24
+ (function(h){var k=Array.prototype.slice,f=h.setTimeout;h.setTimeout=function(){var e=k.call(arguments,0),h=e[0];e[0]=function(){try{h.apply(this,arguments)}catch(e){throw TraceKit.report(e),e;}};return f.apply(this,e)};var e=h.setInterval;h.setInterval=function(){var f=k.call(arguments,0),h=f[0];f[0]=function(){try{h.apply(this,arguments)}catch(e){throw TraceKit.report(e),e;}};return e.apply(this,f)}})(window);
@@ -0,0 +1,260 @@
1
+ // Generated by CoffeeScript 1.4.0
2
+ (function() {
3
+ var root, _SquashJavascript,
4
+ __hasProp = {}.hasOwnProperty,
5
+ __slice = [].slice;
6
+
7
+ root = typeof exports !== "undefined" && exports !== null ? exports : this;
8
+
9
+ root.SquashJavascript = (function() {
10
+ var _instance;
11
+
12
+ function SquashJavascript() {}
13
+
14
+ _instance = void 0;
15
+
16
+ SquashJavascript.instance = function() {
17
+ return _instance != null ? _instance : _instance = new _SquashJavascript();
18
+ };
19
+
20
+ return SquashJavascript;
21
+
22
+ })();
23
+
24
+ _SquashJavascript = (function() {
25
+ var ISODateString, any, buildBacktrace, mergeBang;
26
+
27
+ function _SquashJavascript() {
28
+ TraceKit.report.subscribe(function(error) {
29
+ return SquashJavascript.instance().report(error);
30
+ });
31
+ }
32
+
33
+ _SquashJavascript.prototype.configure = function(options) {
34
+ var key, value, _results;
35
+ this.options || (this.options = {
36
+ disabled: false,
37
+ notifyPath: '/api/1.0/notify',
38
+ transmitTimeout: 15000,
39
+ ignoredExceptionClasses: [],
40
+ ignoredExceptionMessages: {}
41
+ });
42
+ _results = [];
43
+ for (key in options) {
44
+ if (!__hasProp.call(options, key)) continue;
45
+ value = options[key];
46
+ _results.push(this.options[key] = value);
47
+ }
48
+ return _results;
49
+ };
50
+
51
+ _SquashJavascript.prototype.notify = function(error) {
52
+ if (error instanceof Error) {
53
+ return TraceKit.report(error);
54
+ } else {
55
+ throw error;
56
+ }
57
+ };
58
+
59
+ _SquashJavascript.prototype.report = function(error) {
60
+ var body, fields, matches, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
61
+ try {
62
+ if ((_ref = this.options) != null ? _ref.disabled : void 0) {
63
+ return false;
64
+ }
65
+ if (!((_ref1 = this.options) != null ? _ref1.APIKey : void 0) || !((_ref2 = this.options) != null ? _ref2.environment : void 0) || !((_ref3 = this.options) != null ? _ref3.revision : void 0) || !((_ref4 = this.options) != null ? _ref4.APIHost : void 0)) {
66
+ console.error("Missing required Squash configuration keys");
67
+ return false;
68
+ }
69
+ if (this.shouldIgnoreError(error)) {
70
+ return false;
71
+ }
72
+ if (!error.stack) {
73
+ return false;
74
+ }
75
+ fields = arguments[1] || new Object();
76
+ fields.api_key = this.options.APIKey;
77
+ fields.environment = this.options.environment;
78
+ fields.client = "javascript";
79
+ fields.revision = this.options.revision;
80
+ fields.class_name = error.type || error.name;
81
+ if (!error.name && (matches = error.message.match(/^(Uncaught )?(\w+): (.+)/))) {
82
+ fields.class_name = matches[2];
83
+ fields.message = matches[3];
84
+ } else {
85
+ fields.message = error.message;
86
+ }
87
+ if ((_ref5 = fields.class_name) == null) {
88
+ fields.class_name = 'Error';
89
+ }
90
+ fields.backtraces = buildBacktrace(error.stack);
91
+ fields.capture_method = error.mode;
92
+ fields.occurred_at = ISODateString(new Date());
93
+ fields.schema = window.location.protocol.replace(/:$/, '');
94
+ fields.host = window.location.hostname;
95
+ if (window.location.port.length > 0) {
96
+ fields.port = window.location.port;
97
+ }
98
+ fields.path = window.location.pathname;
99
+ fields.query = window.location.search;
100
+ if (window.location.hash !== '') {
101
+ fields.fragment = window.location.hash;
102
+ }
103
+ fields.user_agent = navigator.userAgent;
104
+ fields.screen_width = screen.width;
105
+ fields.screen_height = screen.height;
106
+ fields.window_width = window.innerWidth;
107
+ fields.window_height = window.innerHeight;
108
+ fields.color_depth = screen.colorDepth;
109
+ body = JSON.stringify(fields);
110
+ this.HTTPTransmit(this.options.APIHost + this.options.notifyPath, [['Content-Type', 'application/json']], body);
111
+ return true;
112
+ } catch (internal_error) {
113
+ console.error("Error while trying to notify Squash:", internal_error.stack);
114
+ return console.error("-- original error:", error);
115
+ }
116
+ };
117
+
118
+ _SquashJavascript.prototype.addUserData = function(data, block) {
119
+ var _ref;
120
+ try {
121
+ return block();
122
+ } catch (err) {
123
+ if ((_ref = err._squash_user_data) == null) {
124
+ err._squash_user_data = {};
125
+ }
126
+ mergeBang(err._squash_user_data, data);
127
+ throw err;
128
+ }
129
+ };
130
+
131
+ _SquashJavascript.prototype.addingUserData = function(data, block) {
132
+ return function() {
133
+ var args;
134
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
135
+ return SquashJavascript.instance().addUserData(data, function() {
136
+ return block.apply(null, args);
137
+ });
138
+ };
139
+ };
140
+
141
+ _SquashJavascript.prototype.ignoreExceptions = function() {
142
+ var block, exceptions, _i;
143
+ exceptions = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), block = arguments[_i++];
144
+ try {
145
+ return block();
146
+ } catch (err) {
147
+ err._squash_ignored_exceptions = (err._squash_ignored_exceptions || []).concat(exceptions);
148
+ throw err;
149
+ }
150
+ };
151
+
152
+ _SquashJavascript.prototype.ignoringExceptions = function() {
153
+ var block, exceptions, _i;
154
+ exceptions = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), block = arguments[_i++];
155
+ return function() {
156
+ var args, _ref;
157
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
158
+ return (_ref = SquashJavascript.instance()).ignoreExceptions.apply(_ref, __slice.call(exceptions).concat([function() {
159
+ return block.apply(null, args);
160
+ }]));
161
+ };
162
+ };
163
+
164
+ _SquashJavascript.prototype.HTTPTransmit = function(url, headers, body) {
165
+ var header, request, _i, _len;
166
+ request = new XMLHttpRequest();
167
+ request.timeout = this.options.transmitTimeout;
168
+ request.open("POST", url, true);
169
+ for (_i = 0, _len = headers.length; _i < _len; _i++) {
170
+ header = headers[_i];
171
+ request.setRequestHeader(header[0], header[1]);
172
+ }
173
+ request.send(body);
174
+ return request;
175
+ };
176
+
177
+ _SquashJavascript.prototype.shouldIgnoreError = function(error) {
178
+ var ignored_classes;
179
+ ignored_classes = this.options.ignoredExceptionClasses.concat(error._squash_ignored_exceptions || []);
180
+ if (any(ignored_classes, function(klass) {
181
+ return error.name === klass;
182
+ })) {
183
+ return true;
184
+ }
185
+ return any(this.options.ignoredExceptionMessages, function(class_name, messages) {
186
+ if (error.name === class_name) {
187
+ return any(messages, function(message) {
188
+ return error.message.match(message);
189
+ });
190
+ } else {
191
+ return false;
192
+ }
193
+ });
194
+ };
195
+
196
+ buildBacktrace = function(stack) {
197
+ var backtraces, context, line, _i, _len;
198
+ backtraces = [];
199
+ for (_i = 0, _len = stack.length; _i < _len; _i++) {
200
+ line = stack[_i];
201
+ context = line.context;
202
+ if (context && any(context, function(cline) {
203
+ return cline.length > 200;
204
+ })) {
205
+ context = null;
206
+ }
207
+ backtraces.push(['_JS_ASSET_', line.url, line.line, line.column, line.func, context]);
208
+ }
209
+ return [["Active Thread", true, backtraces]];
210
+ };
211
+
212
+ ISODateString = function(d) {
213
+ var pad;
214
+ pad = function(n) {
215
+ if (n < 10) {
216
+ return '0' + n;
217
+ } else {
218
+ return n;
219
+ }
220
+ };
221
+ return "" + (d.getUTCFullYear()) + "-" + (pad(d.getUTCMonth() + 1)) + "-" + (pad(d.getUTCDate())) + "T" + (pad(d.getUTCHours())) + ":" + (pad(d.getUTCMinutes())) + ":" + (pad(d.getUTCSeconds())) + "Z";
222
+ };
223
+
224
+ any = function(obj, condition) {
225
+ var element, key, value, _i, _len;
226
+ if (obj instanceof Array) {
227
+ for (_i = 0, _len = obj.length; _i < _len; _i++) {
228
+ element = obj[_i];
229
+ if (condition(element)) {
230
+ return true;
231
+ }
232
+ }
233
+ } else {
234
+ for (key in obj) {
235
+ if (!__hasProp.call(obj, key)) continue;
236
+ value = obj[key];
237
+ if (condition(key, value)) {
238
+ return true;
239
+ }
240
+ }
241
+ }
242
+ return false;
243
+ };
244
+
245
+ mergeBang = function(modified, constant) {
246
+ var key, value, _results;
247
+ _results = [];
248
+ for (key in constant) {
249
+ if (!__hasProp.call(constant, key)) continue;
250
+ value = constant[key];
251
+ _results.push(modified[key] = value);
252
+ }
253
+ return _results;
254
+ };
255
+
256
+ return _SquashJavascript;
257
+
258
+ })();
259
+
260
+ }).call(this);
metadata ADDED
@@ -0,0 +1,175 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: squash_javascript
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Tim Morgan
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: railties
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '3.1'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '3.1'
30
+ - !ruby/object:Gem::Dependency
31
+ name: json
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: squash_uploader
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: yard
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: redcarpet
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: jeweler
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: rspec
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ description: This client library records exceptions in front-end JavaScript code to
127
+ Squash.
128
+ email: tim@squareup.com
129
+ executables:
130
+ - upload_source_map
131
+ extensions: []
132
+ extra_rdoc_files:
133
+ - LICENSE.txt
134
+ - README.md
135
+ files:
136
+ - LICENSE.txt
137
+ - README.md
138
+ - bin/upload_source_map
139
+ - lib/squash/javascript.rb
140
+ - lib/squash/javascript/engine.rb
141
+ - lib/squash/javascript/source_map.rb
142
+ - vendor/assets/javascripts/squash_javascript.min.js
143
+ - vendor/assets/javascripts/squash_javascript.orig.js
144
+ - vendor/assets/javascripts/squash_javascript/client.coffee
145
+ - vendor/assets/javascripts/squash_javascript/index.js
146
+ - vendor/assets/javascripts/squash_javascript/tracekit.js
147
+ homepage: http://github.com/SquareSquash/javascript
148
+ licenses:
149
+ - Apache 2.0
150
+ post_install_message:
151
+ rdoc_options: []
152
+ require_paths:
153
+ - lib
154
+ required_ruby_version: !ruby/object:Gem::Requirement
155
+ none: false
156
+ requirements:
157
+ - - ! '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ segments:
161
+ - 0
162
+ hash: 2012466656997614263
163
+ required_rubygems_version: !ruby/object:Gem::Requirement
164
+ none: false
165
+ requirements:
166
+ - - ! '>='
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ requirements: []
170
+ rubyforge_project:
171
+ rubygems_version: 1.8.24
172
+ signing_key:
173
+ specification_version: 3
174
+ summary: Squash client for JavaScript projects
175
+ test_files: []