wunderbar 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/wunderbar/eventsource.rb +5 -0
- data/lib/wunderbar/vendor/eventsource.min.js +6 -0
- data/lib/wunderbar/version.rb +1 -1
- data/wunderbar.gemspec +3 -3
- metadata +4 -2
@@ -0,0 +1,6 @@
|
|
1
|
+
/** @license
|
2
|
+
* eventsource.js
|
3
|
+
* Available under MIT License (MIT)
|
4
|
+
* https://github.com/Yaffle/EventSource/
|
5
|
+
*/
|
6
|
+
!function(a){"use strict";function b(){this.data={}}function c(){this.listeners=new b}function d(a){setTimeout(function(){throw a},0)}function e(a){this.type=a,this.target=void 0}function f(a,b){e.call(this,a),this.data=b.data,this.lastEventId=b.lastEventId}function x(a,b){var c=a;return c!==c&&(c=b),v>c?v:c>w?w:c}function y(a,b,c){try{"function"==typeof b&&b.call(a,c)}catch(e){d(e)}}function z(b,d){function P(){H=o,void 0!==D&&(D.abort(),D=void 0),0!==E&&(clearTimeout(E),E=0),0!==F&&(clearTimeout(F),F=0),A.readyState=o}function Q(a){var c=H===n||H===m?D.responseText:"",d=void 0,g=!1;if(H===m){var i=0,k="",F=void 0;if(j)try{i=D.status,k=D.statusText,F=D.getResponseHeader("Content-Type")}catch(Q){i=0,k="",F=void 0}else""!==a&&"error"!==a&&(i=200,k="OK",F=D.contentType);if((void 0===F||null===F)&&(F=""),0===i&&""===k&&"load"===a&&""!==c&&(i=200,k="OK",""===F)){var R=/^data\:([^,]*?)(?:;base64)?,[\S]*$/.exec(b);void 0!==R&&null!==R&&(F=R[1])}if(200===i&&u.test(F)){if(H=n,C=!0,B=h,A.readyState=n,d=new e("open"),A.dispatchEvent(d),y(A,A.onopen,d),H===o)return}else if(0!==i){var S="";S=200!==i?"EventSource's response has a status "+i+" "+k.replace(/\s+/g," ")+" that is not 200. Aborting the connection.":"EventSource's response has a Content-Type specifying an unsupported type: "+F.replace(/\s+/g," ")+". Aborting the connection.",setTimeout(function(){throw new Error(S)},0),g=!0}}if(H===n){c.length>G&&(C=!0);for(var T=G-1,U=c.length,V="\n";++T<U;)if(V=c.charAt(T),M===p&&"\n"===V)M=q;else if(M===p&&(M=q),"\r"===V||"\n"===V){if("data"===N?I.push(O):"id"===N?J=O:"event"===N?K=O:"retry"===N?(h=x(Number(O),h),B=h):"heartbeatTimeout"===N&&(v=x(Number(O),v),0!==E&&(clearTimeout(E),E=setTimeout(L,v))),O="",N="",M===q){if(0!==I.length&&(z=J,""===K&&(K="message"),d=new f(K,{data:I.join("\n"),lastEventId:J}),A.dispatchEvent(d),"message"===K&&y(A,A.onmessage,d),H===o))return;I.length=0,K=""}M="\r"===V?p:q}else M===q&&(M=r),M===r?":"===V?M=s:N+=V:M===s?(" "!==V&&(O+=V),M=t):M===t&&(O+=V);G=U}H!==n&&H!==m||!("load"===a||"error"===a||g||G>1048576||0===E&&!C)?0===E&&(C=!1,E=setTimeout(L,v)):(g?P():(H=l,D.abort(),0!==E&&(clearTimeout(E),E=0),B>16*h&&(B=16*h),B>w&&(B=w),E=setTimeout(L,B),B=2*B+1,A.readyState=m),d=new e("error"),A.dispatchEvent(d),y(A,A.onerror,d))}function R(){Q("progress")}function S(){Q("load")}function T(){Q("error")}b=b.toString();var g=i&&void 0!==d&&Boolean(d.withCredentials),h=x(1e3,0),v=x(45e3,0),z="",A=this,B=h,C=!1,D=new k,E=0,F=0,G=0,H=l,I=[],J="",K="",L=void 0,M=q,N="",O="";j&&(F=setTimeout(function U(){3===D.readyState&&Q("progress"),F=setTimeout(U,500)},0)),L=function(){if(E=0,H!==l)return Q(""),void 0;if(j&&(void 0!==D.sendAsBinary||void 0===D.onloadend)&&void 0!==a.document&&void 0!==a.document.readyState&&"complete"!==a.document.readyState)return E=setTimeout(L,4),void 0;D.onload=S,D.onerror=T,j&&(D.onabort=T,D.onreadystatechange=R),D.onprogress=R,C=!1,E=setTimeout(L,v),G=0,H=m,I.length=0,K="",J=z,O="",N="",M=q;var c=b.slice(0,5);c="data:"!==c&&"blob:"!==c?b+((-1===b.indexOf("?",0)?"?":"&")+"lastEventId="+encodeURIComponent(z)+"&r="+(Math.random()+1).toString().slice(2)):b,D.open("GET",c,!0),j&&(D.withCredentials=g,D.responseType="text",D.setRequestHeader("Accept","text/event-stream")),D.send(void 0)},c.call(this),this.close=P,this.url=b,this.readyState=m,this.withCredentials=g,this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,L()}function A(){this.CONNECTING=m,this.OPEN=n,this.CLOSED=o}b.prototype={get:function(a){return this.data[a+"~"]},set:function(a,b){this.data[a+"~"]=b},"delete":function(a){delete this.data[a+"~"]}},c.prototype={dispatchEvent:function(a){a.target=this;var b=a.type.toString(),c=this.listeners,e=c.get(b);if(void 0!==e)for(var f=e.length,g=-1,h=void 0;++g<f;){h=e[g];try{h.call(this,a)}catch(i){d(i)}}},addEventListener:function(a,b){a=a.toString();var c=this.listeners,d=c.get(a);void 0===d&&(d=[],c.set(a,d));for(var e=d.length;--e>=0;)if(d[e]===b)return;d.push(b)},removeEventListener:function(a,b){a=a.toString();var c=this.listeners,d=c.get(a);if(void 0!==d){for(var e=d.length,f=[],g=-1;++g<e;)d[g]!==b&&f.push(d[g]);0===f.length?c["delete"](a):c.set(a,f)}}},f.prototype=e.prototype;var g=a.XMLHttpRequest,h=a.XDomainRequest,i=void 0!==g&&void 0!==(new g).withCredentials,j=i,k=i?g:void 0!==h?h:void 0,l=-1,m=0,n=1,o=2,p=3,q=4,r=5,s=6,t=7,u=/^text\/event\-stream;?(\s*charset\=utf\-8)?$/i,v=1e3,w=18e6;A.prototype=c.prototype,z.prototype=new A,A.call(z);var B=function(){if(void 0!==a.EventSource)try{var b=new a.EventSource("data:text/event-stream;charset=utf-8,");return b.close(),b.withCredentials===!1&&""!==b.url}catch(c){d(c)}return!1};void 0===k||B()||(a.NativeEventSource=a.EventSource,a.EventSource=z)}(this);
|
data/lib/wunderbar/version.rb
CHANGED
data/wunderbar.gemspec
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "wunderbar"
|
5
|
-
s.version = "1.0.
|
5
|
+
s.version = "1.0.5"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Sam Ruby"]
|
9
|
-
s.date = "2015-05-
|
9
|
+
s.date = "2015-05-04"
|
10
10
|
s.description = " Wunderbar makes it easy to produce valid HTML5, wellformed XHTML, Unicode\n (utf-8), consistently indented, readable applications.'\n"
|
11
11
|
s.email = "rubys@intertwingly.net"
|
12
|
-
s.files = ["wunderbar.gemspec", "README.md", "COPYING", "lib/wunderbar.rb", "lib/wunderbar", "lib/wunderbar/script.rb", "lib/wunderbar/jquery.rb", "lib/wunderbar/underscore.rb", "lib/wunderbar/polymer.rb", "lib/wunderbar/jquery", "lib/wunderbar/jquery/filter.rb", "lib/wunderbar/jquery/stupidtable.rb", "lib/wunderbar/vendor", "lib/wunderbar/vendor/polymer-v0.0.20131003.min.js", "lib/wunderbar/vendor/marked.min.js", "lib/wunderbar/vendor/stupidtable.min.js", "lib/wunderbar/vendor/bootstrap.min.js", "lib/wunderbar/vendor/Markdown.Converter.js", "lib/wunderbar/vendor/angular.min.js", "lib/wunderbar/vendor/react-0.13.2.min.js", "lib/wunderbar/vendor/jquery-1.11.2.min.js", "lib/wunderbar/vendor/bootstrap-theme.min.css", "lib/wunderbar/vendor/angular-resource.min.js", "lib/wunderbar/vendor/bootstrap.min.css", "lib/wunderbar/vendor/underscore-min.js", "lib/wunderbar/vendor/angular-route.min.js", "lib/wunderbar/websocket.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/listen.rb", "lib/wunderbar/pagedown.rb", "lib/wunderbar/version.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/server.rb", "lib/wunderbar/angularjs.rb", "lib/wunderbar/logger.rb", "lib/wunderbar/asset.rb", "lib/wunderbar/backtick.rb", "lib/wunderbar/coffeescript.rb", "lib/wunderbar/markdown.rb", "lib/wunderbar/installation.rb", "lib/wunderbar/bootstrap.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/sinatra.rb", "lib/wunderbar/rails.rb", "lib/wunderbar/angularjs", "lib/wunderbar/angularjs/resource.rb", "lib/wunderbar/angularjs/route.rb", "lib/wunderbar/rack.rb", "lib/wunderbar/coderay.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/marked.rb", "lib/wunderbar/bootstrap", "lib/wunderbar/bootstrap/theme.rb", "lib/wunderbar/cssproxy.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/node.rb", "lib/wunderbar/react.rb"]
|
12
|
+
s.files = ["wunderbar.gemspec", "README.md", "COPYING", "lib/wunderbar.rb", "lib/wunderbar", "lib/wunderbar/script.rb", "lib/wunderbar/jquery.rb", "lib/wunderbar/underscore.rb", "lib/wunderbar/polymer.rb", "lib/wunderbar/jquery", "lib/wunderbar/jquery/filter.rb", "lib/wunderbar/jquery/stupidtable.rb", "lib/wunderbar/vendor", "lib/wunderbar/vendor/polymer-v0.0.20131003.min.js", "lib/wunderbar/vendor/marked.min.js", "lib/wunderbar/vendor/stupidtable.min.js", "lib/wunderbar/vendor/bootstrap.min.js", "lib/wunderbar/vendor/Markdown.Converter.js", "lib/wunderbar/vendor/angular.min.js", "lib/wunderbar/vendor/react-0.13.2.min.js", "lib/wunderbar/vendor/jquery-1.11.2.min.js", "lib/wunderbar/vendor/bootstrap-theme.min.css", "lib/wunderbar/vendor/angular-resource.min.js", "lib/wunderbar/vendor/bootstrap.min.css", "lib/wunderbar/vendor/underscore-min.js", "lib/wunderbar/vendor/eventsource.min.js", "lib/wunderbar/vendor/angular-route.min.js", "lib/wunderbar/websocket.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/listen.rb", "lib/wunderbar/pagedown.rb", "lib/wunderbar/version.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/server.rb", "lib/wunderbar/eventsource.rb", "lib/wunderbar/angularjs.rb", "lib/wunderbar/logger.rb", "lib/wunderbar/asset.rb", "lib/wunderbar/backtick.rb", "lib/wunderbar/coffeescript.rb", "lib/wunderbar/markdown.rb", "lib/wunderbar/installation.rb", "lib/wunderbar/bootstrap.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/sinatra.rb", "lib/wunderbar/rails.rb", "lib/wunderbar/angularjs", "lib/wunderbar/angularjs/resource.rb", "lib/wunderbar/angularjs/route.rb", "lib/wunderbar/rack.rb", "lib/wunderbar/coderay.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/marked.rb", "lib/wunderbar/bootstrap", "lib/wunderbar/bootstrap/theme.rb", "lib/wunderbar/cssproxy.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/node.rb", "lib/wunderbar/react.rb"]
|
13
13
|
s.homepage = "http://github.com/rubys/wunderbar"
|
14
14
|
s.licenses = ["MIT"]
|
15
15
|
s.require_paths = ["lib"]
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: wunderbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.0.
|
5
|
+
version: 1.0.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Sam Ruby
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-05-
|
12
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- lib/wunderbar/vendor/angular-resource.min.js
|
57
57
|
- lib/wunderbar/vendor/bootstrap.min.css
|
58
58
|
- lib/wunderbar/vendor/underscore-min.js
|
59
|
+
- lib/wunderbar/vendor/eventsource.min.js
|
59
60
|
- lib/wunderbar/vendor/angular-route.min.js
|
60
61
|
- lib/wunderbar/websocket.rb
|
61
62
|
- lib/wunderbar/environment.rb
|
@@ -64,6 +65,7 @@ files:
|
|
64
65
|
- lib/wunderbar/version.rb
|
65
66
|
- lib/wunderbar/cgi-methods.rb
|
66
67
|
- lib/wunderbar/server.rb
|
68
|
+
- lib/wunderbar/eventsource.rb
|
67
69
|
- lib/wunderbar/angularjs.rb
|
68
70
|
- lib/wunderbar/logger.rb
|
69
71
|
- lib/wunderbar/asset.rb
|