em-websocket-client 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/em-websocket-client.gemspec +2 -2
- data/lib/em-websocket-client.rb +28 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/em-websocket-client.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{em-websocket-client}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Micah Wylde"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-08-02}
|
13
13
|
s.description = %q{A WebSocket client implementation for EventMachine}
|
14
14
|
s.email = %q{mwylde@wesleyan.edu}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/em-websocket-client.rb
CHANGED
@@ -1,6 +1,34 @@
|
|
1
1
|
require 'uri'
|
2
2
|
require 'libwebsocket'
|
3
3
|
|
4
|
+
# Monkey patch libwebsocket to support parameters in URLs
|
5
|
+
module LibWebSocket
|
6
|
+
class URL
|
7
|
+
def parse(string)
|
8
|
+
return nil unless string.is_a?(String)
|
9
|
+
|
10
|
+
uri = Addressable::URI.parse(string)
|
11
|
+
|
12
|
+
scheme = uri.scheme
|
13
|
+
return nil unless scheme
|
14
|
+
|
15
|
+
self.secure = true if scheme.match(/ss\Z/m)
|
16
|
+
|
17
|
+
host = uri.host
|
18
|
+
host = '/' unless host && host != ''
|
19
|
+
self.host = host
|
20
|
+
self.port = uri.port.to_s if uri.port
|
21
|
+
|
22
|
+
request_uri = uri.path
|
23
|
+
request_uri = '/' unless request_uri && request_uri != ''
|
24
|
+
request_uri += "?" + uri.query if uri.query
|
25
|
+
self.resource_name = request_uri
|
26
|
+
|
27
|
+
return self
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
4
32
|
module EventMachine
|
5
33
|
class WebSocketClient < Connection
|
6
34
|
include Deferrable
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: em-websocket-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Micah Wylde
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-08-02 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -123,7 +123,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
123
|
requirements:
|
124
124
|
- - ">="
|
125
125
|
- !ruby/object:Gem::Version
|
126
|
-
hash: -
|
126
|
+
hash: -3387102389269862192
|
127
127
|
segments:
|
128
128
|
- 0
|
129
129
|
version: "0"
|