socky 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.textile +7 -0
- data/VERSION +1 -1
- data/lib/socky/connection.rb +3 -2
- data/lib/socky/connection/finders.rb +4 -11
- data/lib/socky/options/config.rb +2 -2
- data/spec/files/default.yml +2 -2
- data/spec/socky/options/config_spec.rb +0 -2
- metadata +4 -4
data/CHANGELOG.textile
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
h1. Changelog
|
2
2
|
|
3
|
+
h2. 0.2.1 / 2010-10-09
|
4
|
+
|
5
|
+
* new features:
|
6
|
+
** default config should have subscribe url's commented out for starting users
|
7
|
+
* bugfixes:
|
8
|
+
** show sent messages in true form instead of "inspect" one
|
9
|
+
|
3
10
|
h2. 0.2.0 / 2010-10-03
|
4
11
|
|
5
12
|
* new features:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/socky/connection.rb
CHANGED
@@ -112,8 +112,9 @@ module Socky
|
|
112
112
|
private
|
113
113
|
|
114
114
|
def send_data(data)
|
115
|
-
|
116
|
-
|
115
|
+
json_data = data.to_json
|
116
|
+
debug [self.name, "sending data", json_data]
|
117
|
+
socket.send json_data
|
117
118
|
end
|
118
119
|
|
119
120
|
def connection_pool
|
@@ -41,8 +41,8 @@ module Socky
|
|
41
41
|
# Empty table means "no users" - nil means "all users"
|
42
42
|
return [] if (included_clients.is_a?(Array) && included_clients.empty?)
|
43
43
|
|
44
|
-
included_clients =
|
45
|
-
excluded_clients =
|
44
|
+
included_clients = Array(included_clients)
|
45
|
+
excluded_clients = Array(excluded_clients)
|
46
46
|
|
47
47
|
connections.collect do |connection|
|
48
48
|
connection if (included_clients.empty? || included_clients.include?(connection.client)) && !excluded_clients.include?(connection.client)
|
@@ -53,8 +53,8 @@ module Socky
|
|
53
53
|
# Empty table means "no channels" - nil means "all channels"
|
54
54
|
return [] if (included_channels.is_a?(Array) && included_channels.empty?)
|
55
55
|
|
56
|
-
included_channels =
|
57
|
-
excluded_channels =
|
56
|
+
included_channels = Array(included_channels)
|
57
|
+
excluded_channels = Array(excluded_channels)
|
58
58
|
|
59
59
|
connections.collect do |connection|
|
60
60
|
connection if connection.channels.any? do |channel|
|
@@ -62,13 +62,6 @@ module Socky
|
|
62
62
|
end
|
63
63
|
end.compact
|
64
64
|
end
|
65
|
-
|
66
|
-
# This is implemented due to differences between methods of handling to_a in ruby 1.8 and 1.9
|
67
|
-
def to_array(obj)
|
68
|
-
return [] if obj.nil?
|
69
|
-
return obj if obj.is_a?(Array)
|
70
|
-
[obj]
|
71
|
-
end
|
72
65
|
end
|
73
66
|
end
|
74
67
|
end
|
data/lib/socky/options/config.rb
CHANGED
@@ -56,8 +56,8 @@ module Socky
|
|
56
56
|
:port: 8080
|
57
57
|
:debug: false
|
58
58
|
|
59
|
-
:subscribe_url: http://localhost:3000/socky/subscribe
|
60
|
-
:unsubscribe_url: http://localhost:3000/socky/unsubscribe
|
59
|
+
# :subscribe_url: http://localhost:3000/socky/subscribe
|
60
|
+
# :unsubscribe_url: http://localhost:3000/socky/unsubscribe
|
61
61
|
|
62
62
|
:secret: my_secret_key
|
63
63
|
|
data/spec/files/default.yml
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
:port: 8080
|
2
2
|
:debug: false
|
3
3
|
|
4
|
-
:subscribe_url: http://localhost:3000/socky/subscribe
|
5
|
-
:unsubscribe_url: http://localhost:3000/socky/unsubscribe
|
4
|
+
# :subscribe_url: http://localhost:3000/socky/subscribe
|
5
|
+
# :unsubscribe_url: http://localhost:3000/socky/unsubscribe
|
6
6
|
|
7
7
|
:secret: my_secret_key
|
8
8
|
|
@@ -64,8 +64,6 @@ describe Socky::Options::Config do
|
|
64
64
|
{
|
65
65
|
:port => 8080,
|
66
66
|
:debug => false,
|
67
|
-
:subscribe_url => "http://localhost:3000/socky/subscribe",
|
68
|
-
:unsubscribe_url => "http://localhost:3000/socky/unsubscribe",
|
69
67
|
:secret => "my_secret_key",
|
70
68
|
:secure => false
|
71
69
|
}
|
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: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
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-10-
|
18
|
+
date: 2010-10-09 00:00:00 +02:00
|
19
19
|
default_executable: socky
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|