sinatra-websocketio 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/sinatra-websocketio/version.rb +1 -1
- data/lib/sinatra-websocketio/websocketio.rb +6 -5
- metadata +2 -2
data/History.txt
CHANGED
@@ -47,17 +47,18 @@ module Sinatra
|
|
47
47
|
|
48
48
|
def self.push(type, data, opt={})
|
49
49
|
session_ids = opt[:to].to_s.empty? ? self.sessions.keys : [opt[:to]]
|
50
|
-
if opt.include? :to
|
50
|
+
if opt.include? :to
|
51
|
+
return unless self.sessions.include? opt[:to]
|
51
52
|
s = self.sessions[opt[:to]]
|
52
53
|
begin
|
53
54
|
s.send({:type => type, :data => data}.to_json)
|
54
55
|
rescue => e
|
55
56
|
emit :error, "websocketio push error (session:#{opt[:to]})"
|
56
57
|
end
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
return
|
59
|
+
end
|
60
|
+
self.sessions.keys.each do |id|
|
61
|
+
push type, data, :to => id
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-websocketio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|