sinatra-rocketio 0.3.0 → 0.3.1

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: 4b79c54a4625daf478248080e3030bd3c616b6fa
4
- data.tar.gz: fc17414c382d82e9d489c440ffa4b38aeafd5763
3
+ metadata.gz: 7d6fd962e14fc6929da8f5143c3ed8cd12776937
4
+ data.tar.gz: 6873e400995be6dcc7a2c3e8688fad3353db71f4
5
5
  SHA512:
6
- metadata.gz: 819632a1f9940f5d01249518dbde89b6e660ad6f9fb1973a1f5a2d0a3d728ea31f7a3fad1926de32c41a4f11588e84729e16ab7b578e4535ee460b7537dd2d3e
7
- data.tar.gz: 729e355f593282179ff61436757cddd0449a66e371c3def725d416dd403c275d3bd07694c2350b52fc37fdda0730f06757c2ff2f90236bb0cb060837c0c6aab2
6
+ metadata.gz: 116c61a5dc8ddfa031af77263ebc1e4205604b6be1d8e13db64cef399843763fade524cd74d99161029548a208d16fccab202c1caa9d81446ff6dd2672042518
7
+ data.tar.gz: 13276fb030f0f526468a138b85d574bf48ac357ee1f7faf69082b6b6ae5b4a13c4bd58f93db4a5e2f89810df780df50debcf8bd2b1d210f9a471985725cc3e0d
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.3.1 2013-10-03
2
+
3
+ * bugfix of push
4
+
1
5
  === 0.3.0 2013-10-02
2
6
 
3
7
  * get client address with Sinatra::RocketIO::ClientInfo#address
@@ -38,20 +38,26 @@ Sinatra::RocketIO.once :start do
38
38
  if options[:comet]
39
39
  Sinatra::CometIO.on :* do |event_name, *args|
40
40
  event_name = :__connect if event_name == :connect
41
+ session_id = args.size > 1 ? args[1] : args[0]
42
+ address = sessions.include?(session_id) ? sessions[session_id][:remote_addr] : nil
43
+ info = Sinatra::RocketIO::ClientInfo.new(:session => session_id, :address => address, :channel => Sinatra::RocketIO.channels[session_id], :type => :comet)
41
44
  if args.size > 1
42
- Sinatra::RocketIO.emit event_name, args[0], Sinatra::RocketIO::ClientInfo.new(:session => args[1], :address => sessions[args[1]][:remote_addr], :channel => Sinatra::RocketIO.channels[args[1]], :type => :comet)
45
+ Sinatra::RocketIO.emit event_name, args[0], info
43
46
  else
44
- Sinatra::RocketIO.emit event_name, Sinatra::RocketIO::ClientInfo.new(:session => args[0], :address => sessions[args[0]][:remote_addr], :channel => Sinatra::RocketIO.channels[args[0]], :type => :comet)
47
+ Sinatra::RocketIO.emit event_name, info
45
48
  end
46
49
  end
47
50
  end
48
51
  if options[:websocket]
49
52
  Sinatra::WebSocketIO.on :* do |event_name, *args|
50
53
  event_name = :__connect if event_name == :connect
54
+ session_id = args.size > 1 ? args[1] : args[0]
55
+ address = sessions.include?(session_id) ? sessions[session_id][:remote_addr] : nil
56
+ info = Sinatra::RocketIO::ClientInfo.new(:session => session_id, :address => address, :channel => Sinatra::RocketIO.channels[session_id], :type => :websocket)
51
57
  if args.size > 1
52
- Sinatra::RocketIO.emit event_name, args[0], Sinatra::RocketIO::ClientInfo.new(:session => args[1], :address => sessions[args[1]][:remote_addr], :channel => Sinatra::RocketIO.channels[args[1]], :type => :websocket)
58
+ Sinatra::RocketIO.emit event_name, args[0], info
53
59
  else
54
- Sinatra::RocketIO.emit event_name, Sinatra::RocketIO::ClientInfo.new(:session => args[0], :address => sessions[args[0]][:remote_addr], :channel => Sinatra::RocketIO.channels[args[0]], :type => :websocket)
60
+ Sinatra::RocketIO.emit event_name, info
55
61
  end
56
62
  end
57
63
  end
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module RocketIO
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
data/rocketio.js CHANGED
@@ -1,4 +1,4 @@
1
- // RocketIO.js v0.2.6 (websocketio:v0.3.3, cometio:v0.5.8)
1
+ // RocketIO.js v0.3.1 (websocketio:v0.3.7, cometio:v0.5.9)
2
2
  // https://github.com/shokai/sinatra-rocketio
3
3
  // (c) 2013 Sho Hashimoto <hashimoto@shokai.org>
4
4
  // The MIT License
data/rocketio.min.js CHANGED
@@ -1,4 +1,4 @@
1
- // RocketIO.js v0.2.6 (websocketio:v0.3.3, cometio:v0.5.8)
1
+ // RocketIO.js v0.3.1 (websocketio:v0.3.7, cometio:v0.5.9)
2
2
  // https://github.com/shokai/sinatra-rocketio
3
3
  // (c) 2013 Sho Hashimoto <hashimoto@shokai.org>
4
4
  // The MIT License
@@ -26,7 +26,7 @@ Gem::Specification.new do |gem|
26
26
  gem.add_development_dependency "json"
27
27
 
28
28
  gem.add_dependency "sinatra-cometio", ">= 0.5.9"
29
- gem.add_dependency "sinatra-websocketio", ">= 0.3.7"
29
+ gem.add_dependency "sinatra-websocketio", ">= 0.3.8"
30
30
  gem.add_dependency "sinatra"
31
31
  gem.add_dependency "eventmachine", ">= 1.0.0"
32
32
  gem.add_dependency "event_emitter", ">= 0.2.5"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-rocketio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
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
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - '>='
144
144
  - !ruby/object:Gem::Version
145
- version: 0.3.7
145
+ version: 0.3.8
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '>='
151
151
  - !ruby/object:Gem::Version
152
- version: 0.3.7
152
+ version: 0.3.8
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: sinatra
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -277,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
277
  version: '0'
278
278
  requirements: []
279
279
  rubyforge_project:
280
- rubygems_version: 2.0.5
280
+ rubygems_version: 2.1.5
281
281
  signing_key:
282
282
  specification_version: 4
283
283
  summary: WebSocket/Comet IO plugin for Sinatra