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 CHANGED
@@ -1,5 +1,13 @@
1
1
  h1. Changelog
2
2
 
3
+ h2. 0.1.2 / 2010-09-21
4
+
5
+ * new features:
6
+ ** none
7
+ * bugfixes:
8
+ ** fix routes to spec_helper in ruby 1.9.2
9
+ ** ruby 1.9 will no longer raise errors on String to_a call
10
+
3
11
  h2. 0.1.1 / 2010-08-25
4
12
 
5
13
  * new features:
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 breake border between your application and client browser by letting the server initialize a connection and push data to the client.
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
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.to_a
32
- excluded_clients = excluded_clients.to_a
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.to_a
44
- excluded_channels = excluded_channels.to_a
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
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe EM::WebSocket::Connection do
4
4
 
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Socky::Connection::Authentication do
4
4
  include Socky::Connection::Authentication
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Socky::Connection::Finders do
4
4
  include Socky::Connection::Finders
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Socky::Connection do
4
4
 
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Socky::Message do
4
4
  before(:each) do
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Socky::Misc do
4
4
  include Socky::Misc
@@ -1,5 +1,5 @@
1
- require 'spec/spec_helper'
2
- require 'spec/stallion'
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:8080/fail") do |response|
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:8080/") do |response|
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
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  FILES_DIR = File.join(File.dirname(__FILE__), '..', '..', 'files')
4
4
 
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Socky::Options::Parser do
4
4
 
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Socky::Options do
4
4
 
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Socky::Runner do
4
4
 
data/spec/socky_spec.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'spec/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Socky do
4
4
 
data/spec/spec_helper.rb CHANGED
@@ -2,5 +2,5 @@ require 'rubygems'
2
2
  require 'spec'
3
3
  require "spec/autorun"
4
4
 
5
- require 'lib/socky'
5
+ require 'socky'
6
6
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
data/spec/stallion.rb CHANGED
@@ -87,7 +87,7 @@ end
87
87
 
88
88
  Thread.new do
89
89
  begin
90
- Stallion.run :Host => '127.0.0.1', :Port => 8080
90
+ Stallion.run :Host => '127.0.0.1', :Port => 8765
91
91
  rescue Exception => e
92
92
  print e
93
93
  end
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: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.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-08-25 00:00:00 +02:00
18
+ date: 2010-09-21 00:00:00 +02:00
19
19
  default_executable: socky
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency