websocket-client-simple 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.0.3 2013-03-23
2
+
3
+ * :type => :text option in send
4
+
1
5
  === 0.0.2 2013-03-22
2
6
 
3
7
  * remove unnecessary sleep
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
- puts 'close'
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
- frame = ::WebSocket::Frame::Outgoing::Client.new(:data => data, :type => :text, :version => @hs.version)
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
@@ -1,7 +1,7 @@
1
1
  module WebSocket
2
2
  module Client
3
3
  module Simple
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
6
6
  end
7
7
  end
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.2
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: -1361866893056508446
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: -1361866893056508446
174
+ hash: -4519471081797190731
175
175
  requirements: []
176
176
  rubyforge_project:
177
177
  rubygems_version: 1.8.24