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 +4 -4
- data/History.txt +8 -0
- data/lib/sinatra-websocketio/version.rb +1 -1
- data/lib/sinatra-websocketio/websocketio.rb +6 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13eda4c825b371bc35c926c3c8c2d58ea64ab0b6
|
4
|
+
data.tar.gz: 6c2158b2c71090454325b0e28e96127d4103cd3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b481fd4eee043638c155713fec3e0e9231e35b3928d4da6db1559baeea46768f6b66d8d55f4bd03d78a7ab408950ed2e030a0dcddeda6972b197c33dc1c8cbca
|
7
|
+
data.tar.gz: e7b4ed7eb18a179119bfe034a6278e6e4d9e85ceecadda4afc78b03deb504e8fc0137cd55eea5daba20f110e937c3a87ea2517ce9e54f812242d97f759a154b6
|
data/History.txt
CHANGED
@@ -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
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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
|
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.
|
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-
|
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.
|
266
|
+
rubygems_version: 2.1.5
|
267
267
|
signing_key:
|
268
268
|
specification_version: 4
|
269
269
|
summary: WebSocket component for Sinatra RocketIO
|