sinatra-websocketio 0.3.7 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fc55e3907609bd895b48c19fb729e0f736df89b
4
- data.tar.gz: 481b752107069ec050ae664ab3edf9d3afa7ed6d
3
+ metadata.gz: 13eda4c825b371bc35c926c3c8c2d58ea64ab0b6
4
+ data.tar.gz: 6c2158b2c71090454325b0e28e96127d4103cd3e
5
5
  SHA512:
6
- metadata.gz: 6ac10c0e82d00f7fa63159e21752d766d970712e3b4659eb362079628939a832a37e1b1d46517f02efe2ef302fd83b0db655b41300ec9bed509334edd2b61bab
7
- data.tar.gz: 39b50ff3fa9e6e18fe24c16e328167d090ec0dc2a1b79864217a13583e528cf84c1a9edeac9e3cf01e70d3b33176fb077ffd3f5652992ccda971aa206eae4382
6
+ metadata.gz: b481fd4eee043638c155713fec3e0e9231e35b3928d4da6db1559baeea46768f6b66d8d55f4bd03d78a7ab408950ed2e030a0dcddeda6972b197c33dc1c8cbca
7
+ data.tar.gz: e7b4ed7eb18a179119bfe034a6278e6e4d9e85ceecadda4afc78b03deb504e8fc0137cd55eea5daba20f110e937c3a87ea2517ce9e54f812242d97f759a154b6
data/History.txt CHANGED
@@ -1,3 +1,11 @@
1
+ === 0.3.9 2013-10-03
2
+
3
+ * bugfix
4
+
5
+ === 0.3.8 2013-10-03
6
+
7
+ * bugfix of push
8
+
1
9
  === 0.3.7 2013-10-01
2
10
 
3
11
  * little fix
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module WebSocketIO
3
- VERSION = "0.3.7"
3
+ VERSION = "0.3.9"
4
4
  end
5
5
  end
@@ -54,23 +54,22 @@ module Sinatra
54
54
  end
55
55
 
56
56
  def self.push(type, data, opt={})
57
- if opt.include? :to
58
- return unless self.sessions.include? opt[:to]
57
+ if opt.include? :to and self.sessions.include? opt[:to]
59
58
  s = self.sessions[opt[:to]][:websocket]
60
59
  begin
61
60
  s.send({:type => type, :data => data}.to_json)
62
61
  rescue => e
63
62
  emit :error, "websocketio push error (session:#{opt[:to]})"
64
63
  end
65
- return
66
- end
67
- self.sessions.keys.each do |id|
68
- push type, data, :to => id
64
+ else
65
+ self.sessions.keys.each do |id|
66
+ push type, data, :to => id
67
+ end
69
68
  end
70
69
  end
71
70
 
72
71
  def self.sessions
73
- @@sessions ||= Hash.new{|h,k| h[k] = {:websocket => nil, :remote_addr => nil} }
72
+ @@sessions ||= Hash.new
74
73
  end
75
74
 
76
75
  def self.create_session(ip_addr)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-websocketio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-01 00:00:00.000000000 Z
11
+ date: 2013-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -263,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
263
  version: '0'
264
264
  requirements: []
265
265
  rubyforge_project:
266
- rubygems_version: 2.0.5
266
+ rubygems_version: 2.1.5
267
267
  signing_key:
268
268
  specification_version: 4
269
269
  summary: WebSocket component for Sinatra RocketIO