funnel 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/funnel.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'funnel'
3
- s.version = '0.1.2'
3
+ s.version = '0.1.3'
4
4
  s.date = '2009-12-30'
5
5
  s.summary = 'A realtime resource-centric application framework'
6
6
  s.email = 'dan.simpson@gmail.com'
@@ -33,6 +33,6 @@ spec = Gem::Specification.new do |s|
33
33
  'templates/application/config/config.rb',
34
34
  'templates/application/config/routes.rb',
35
35
  'templates/application/script/run',
36
- 'templates/application/handlers'
36
+ 'templates/application/handlers/echo_server.rb'
37
37
  ]
38
38
  end
@@ -1,5 +1,5 @@
1
1
  $:.unshift File.dirname(__FILE__)
2
- FUNNEL_ROOT = File.expand_path('../', __FILE__)
2
+ FUNNEL_ROOT = File.expand_path('../../', __FILE__)
3
3
 
4
4
  require 'rubygems'
5
5
  require 'funnel'
@@ -1,3 +1,3 @@
1
1
  Funnel::Routing::Routes.draw do |map|
2
- map.default :handler => Funnel::Servers::DummyServer
2
+ map.default :handler => EchoServer
3
3
  end
@@ -0,0 +1,19 @@
1
+ class EchoHandler < Funnel::WebSocket::Connection
2
+
3
+ #called when the connection is ready to send
4
+ #and receive data
5
+ def on_ready
6
+ puts "Ready..."
7
+ end
8
+
9
+ #called on disconnect
10
+ def on_disconnect
11
+ puts "Ended"
12
+ end
13
+
14
+ #right back at you
15
+ def on_data msg
16
+ send_message msg
17
+ end
18
+
19
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funnel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Simpson
@@ -48,6 +48,7 @@ files:
48
48
  - templates/application/config/config.rb
49
49
  - templates/application/config/routes.rb
50
50
  - templates/application/script/run
51
+ - templates/application/handlers/echo_server.rb
51
52
  has_rdoc: true
52
53
  homepage: http://github.com/dansimpson/funnel
53
54
  licenses: []