socky 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.textile +8 -0
- data/README.textile +1 -1
- data/Rakefile +0 -9
- data/VERSION +1 -1
- data/lib/socky/connection/finders.rb +10 -4
- data/spec/em-websocket_spec.rb +1 -1
- data/spec/socky/connection/authentication_spec.rb +1 -1
- data/spec/socky/connection/finders_spec.rb +1 -1
- data/spec/socky/connection_spec.rb +1 -1
- data/spec/socky/message_spec.rb +1 -1
- data/spec/socky/misc_spec.rb +1 -1
- data/spec/socky/net_request_spec.rb +4 -4
- data/spec/socky/options/config_spec.rb +1 -1
- data/spec/socky/options/parser_spec.rb +1 -1
- data/spec/socky/options_spec.rb +1 -1
- data/spec/socky/runner_spec.rb +1 -1
- data/spec/socky_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/stallion.rb +1 -1
- metadata +4 -4
data/CHANGELOG.textile
CHANGED
data/README.textile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
h1. Socky
|
2
2
|
|
3
|
-
Socky is push server for Ruby on Rails based on WebSockets. It allows you to
|
3
|
+
Socky is push server for Ruby on Rails based on WebSockets. It allows you to break border between your application and client browser by letting the server initialize a connection and push data to the client.
|
4
4
|
|
5
5
|
h2. Getting Started
|
6
6
|
|
data/Rakefile
CHANGED
@@ -24,12 +24,3 @@ begin
|
|
24
24
|
rescue LoadError
|
25
25
|
puts "Jeweler not available. Install it with: gem install jeweler"
|
26
26
|
end
|
27
|
-
|
28
|
-
begin
|
29
|
-
require 'metric_fu'
|
30
|
-
MetricFu::Configuration.run do |config|
|
31
|
-
# config.graph_engine = :gchart
|
32
|
-
end
|
33
|
-
rescue LoadError
|
34
|
-
puts "MetricFu not available. Install it with: gem install metric_fu"
|
35
|
-
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -28,8 +28,8 @@ module Socky
|
|
28
28
|
# Empty table means "no users" - nil means "all users"
|
29
29
|
return [] if (included_clients.is_a?(Array) && included_clients.empty?)
|
30
30
|
|
31
|
-
included_clients = included_clients
|
32
|
-
excluded_clients = excluded_clients
|
31
|
+
included_clients = to_array(included_clients)
|
32
|
+
excluded_clients = to_array(excluded_clients)
|
33
33
|
|
34
34
|
connections.collect do |connection|
|
35
35
|
connection if (included_clients.empty? || included_clients.include?(connection.client)) && !excluded_clients.include?(connection.client)
|
@@ -40,8 +40,8 @@ module Socky
|
|
40
40
|
# Empty table means "no channels" - nil means "all channels"
|
41
41
|
return [] if (included_channels.is_a?(Array) && included_channels.empty?)
|
42
42
|
|
43
|
-
included_channels = included_channels
|
44
|
-
excluded_channels = excluded_channels
|
43
|
+
included_channels = to_array(included_channels)
|
44
|
+
excluded_channels = to_array(excluded_channels)
|
45
45
|
|
46
46
|
connections.collect do |connection|
|
47
47
|
connection if connection.channels.any? do |channel|
|
@@ -50,6 +50,12 @@ module Socky
|
|
50
50
|
end.compact
|
51
51
|
end
|
52
52
|
|
53
|
+
def to_array(obj)
|
54
|
+
return [] if obj.nil?
|
55
|
+
return obj if obj.is_a?(Array)
|
56
|
+
[obj]
|
57
|
+
end
|
58
|
+
|
53
59
|
end
|
54
60
|
|
55
61
|
end
|
data/spec/em-websocket_spec.rb
CHANGED
data/spec/socky/message_spec.rb
CHANGED
data/spec/socky/misc_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'stallion'
|
3
3
|
|
4
4
|
describe Socky::NetRequest do
|
5
5
|
|
@@ -23,7 +23,7 @@ describe Socky::NetRequest do
|
|
23
23
|
end
|
24
24
|
it "should call block with false if request return status other than 200" do
|
25
25
|
EM.run do
|
26
|
-
described_class.post("http://127.0.0.1:
|
26
|
+
described_class.post("http://127.0.0.1:8765/fail") do |response|
|
27
27
|
response.should be_false
|
28
28
|
EM.stop
|
29
29
|
end.should be_true
|
@@ -31,7 +31,7 @@ describe Socky::NetRequest do
|
|
31
31
|
end
|
32
32
|
it "should call block with true if request return status 200" do
|
33
33
|
EM.run do
|
34
|
-
described_class.post("http://127.0.0.1:
|
34
|
+
described_class.post("http://127.0.0.1:8765/") do |response|
|
35
35
|
response.should be_true
|
36
36
|
EM.stop
|
37
37
|
end.should be_true
|
data/spec/socky/options_spec.rb
CHANGED
data/spec/socky/runner_spec.rb
CHANGED
data/spec/socky_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/spec/stallion.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bernard Potocki
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-09-21 00:00:00 +02:00
|
19
19
|
default_executable: socky
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|