websocket-client-simple 0.0.2 → 0.0.3
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.
- data/History.txt +4 -0
- data/README.md +2 -2
- data/lib/websocket-client-simple/client.rb +3 -2
- data/lib/websocket-client-simple/version.rb +1 -1
- metadata +3 -3
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -22,12 +22,11 @@ ws.on :message do |msg|
|
|
22
22
|
end
|
23
23
|
|
24
24
|
ws.on :open do
|
25
|
-
puts 'open'
|
26
25
|
ws.send 'hello!!!'
|
27
26
|
end
|
28
27
|
|
29
28
|
ws.on :close do |e|
|
30
|
-
|
29
|
+
p e
|
31
30
|
exit 1
|
32
31
|
end
|
33
32
|
```
|
@@ -43,6 +42,7 @@ Test
|
|
43
42
|
|
44
43
|
% gem install bundler
|
45
44
|
% bundle install
|
45
|
+
% export WS_PORT=8888
|
46
46
|
% rake test
|
47
47
|
|
48
48
|
|
@@ -48,9 +48,10 @@ module WebSocket
|
|
48
48
|
@socket.write @hs.to_s
|
49
49
|
end
|
50
50
|
|
51
|
-
def send(data)
|
51
|
+
def send(data, opt={:type => :text})
|
52
52
|
return if !@handshaked or @closed
|
53
|
-
|
53
|
+
type = opt[:type]
|
54
|
+
frame = ::WebSocket::Frame::Outgoing::Client.new(:data => data, :type => type, :version => @hs.version)
|
54
55
|
begin
|
55
56
|
@socket.write frame.to_s
|
56
57
|
rescue => e
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: websocket-client-simple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -162,7 +162,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
162
162
|
version: '0'
|
163
163
|
segments:
|
164
164
|
- 0
|
165
|
-
hash: -
|
165
|
+
hash: -4519471081797190731
|
166
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
167
|
none: false
|
168
168
|
requirements:
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: '0'
|
172
172
|
segments:
|
173
173
|
- 0
|
174
|
-
hash: -
|
174
|
+
hash: -4519471081797190731
|
175
175
|
requirements: []
|
176
176
|
rubyforge_project:
|
177
177
|
rubygems_version: 1.8.24
|