sinatra-rocketio 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/README.md +13 -1
- data/lib/sinatra-rocketio/options.rb +8 -2
- data/lib/sinatra-rocketio/version.rb +1 -1
- data/lib/sinatra/rocketio/client.rb +7 -0
- data/sinatra-rocketio.gemspec +2 -2
- data/test/app/config.ru +0 -2
- data/test/test_channel.rb +1 -1
- data/test/test_push_multi_client.rb +1 -1
- data/test/test_rocketio.rb +1 -1
- data/test/test_settings.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 574c09d0944df2356c86d057c1e80eb81496845b
|
4
|
+
data.tar.gz: 237b7b7762880c7e1d875dbea7e1443731ae36ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b05e9851fc7213cd9a486aecd761830fc1449a264d0f9a68869e4a474673e15a0d22708b054b6665515be74c2831ebd9b868e1c236a620eba8da8619cfc1c4d
|
7
|
+
data.tar.gz: 1d4f6b5018b2921baf2176b9a528fd5fd7f09255f2afcde4b844c652e8dbfa12455b2d70c455bd06f49fb4ea07b913b58a65ee25970b6693b164e49119d438a1
|
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -32,7 +32,7 @@ Server Side
|
|
32
32
|
require 'sinatra'
|
33
33
|
require 'sinatra/rocketio'
|
34
34
|
set :cometio, :timeout => 120, :post_interval => 2
|
35
|
-
set :websocketio, :port =>
|
35
|
+
set :websocketio, :port => 5001
|
36
36
|
set :rocketio, :websocket => true, :comet => true # enable WebSocket and Comet
|
37
37
|
|
38
38
|
run Sinatra::Application
|
@@ -182,6 +182,18 @@ end
|
|
182
182
|
```
|
183
183
|
|
184
184
|
|
185
|
+
### Config with ENV[]
|
186
|
+
|
187
|
+
configure with ENV variables.
|
188
|
+
|
189
|
+
% export WS_PORT=9000
|
190
|
+
% export WEBSOCKET=disable
|
191
|
+
% export COMET=enable
|
192
|
+
% bundle exec rackup config.ru #=> start sinatra app
|
193
|
+
|
194
|
+
disable comet and enable websocket on port 9000.
|
195
|
+
|
196
|
+
|
185
197
|
Sample App
|
186
198
|
----------
|
187
199
|
|
@@ -11,8 +11,14 @@ module Sinatra
|
|
11
11
|
|
12
12
|
def self.default_options
|
13
13
|
{
|
14
|
-
:comet
|
15
|
-
|
14
|
+
:comet => [
|
15
|
+
(ENV["COMET"].to_s =~ /^(false|disable)$/i ? false : true),
|
16
|
+
lambda{|v| [true, false].include? v }
|
17
|
+
],
|
18
|
+
:websocket => [
|
19
|
+
(ENV["WEBSOCKET"].to_s =~ /^(false|disable)$/i ? false : true),
|
20
|
+
lambda{|v| [true, false].include? v }
|
21
|
+
]
|
16
22
|
}
|
17
23
|
end
|
18
24
|
|
data/sinatra-rocketio.gemspec
CHANGED
@@ -25,8 +25,8 @@ Gem::Specification.new do |gem|
|
|
25
25
|
gem.add_development_dependency "httparty"
|
26
26
|
gem.add_development_dependency "json"
|
27
27
|
|
28
|
-
gem.add_dependency "sinatra-cometio", ">= 0.5.
|
29
|
-
gem.add_dependency "sinatra-websocketio", ">= 0.
|
28
|
+
gem.add_dependency "sinatra-cometio", ">= 0.5.6"
|
29
|
+
gem.add_dependency "sinatra-websocketio", ">= 0.3.0"
|
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"
|
data/test/app/config.ru
CHANGED
data/test/test_channel.rb
CHANGED
data/test/test_rocketio.rb
CHANGED
data/test/test_settings.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.5
|
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-05-
|
11
|
+
date: 2013-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -128,28 +128,28 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - '>='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.5.
|
131
|
+
version: 0.5.6
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.5.
|
138
|
+
version: 0.5.6
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: sinatra-websocketio
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - '>='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: 0.3.0
|
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.
|
152
|
+
version: 0.3.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: sinatra
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|