websocket-rack 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.3 / 2011-03-12
4
+
5
+ - fixed critical bug that duplicated instance variables
6
+
3
7
  ## 0.1.2 / 2011-03-08
4
8
 
5
9
  - change Rack::WebSocket::Application @connection variable name to @conn - first one is to often used to block it
data/README.md CHANGED
@@ -91,9 +91,9 @@ Example:
91
91
 
92
92
  Rack env - contain all data sent by client when connectind.
93
93
 
94
- ### @connection
94
+ ### @conn
95
95
 
96
- Thin wrapper between client and EventMachine::Connection
96
+ Connection - thin wrapper between client and EventMachine::Connection
97
97
 
98
98
  ## FAQ
99
99
 
data/example/example.ru CHANGED
@@ -25,7 +25,9 @@ end
25
25
  # use Rack::CommonLogger
26
26
 
27
27
  map '/' do
28
- use MyApp #, :websocket_debug => true
29
-
30
28
  run Rack::File.new(File.expand_path(File.dirname(__FILE__)) + '/html')
31
29
  end
30
+
31
+ map '/websocket' do
32
+ run MyApp.new # :websocket_debug => true
33
+ end
@@ -26,7 +26,7 @@
26
26
 
27
27
  // Connect to Web Socket.
28
28
  // Change host/port here to your own Web Socket server.
29
- ws = new WebSocket("ws://localhost:3000");
29
+ ws = new WebSocket("ws://localhost:3000/websocket");
30
30
 
31
31
  // Set event handlers.
32
32
  ws.onopen = function() {
@@ -2,7 +2,7 @@ require 'rack'
2
2
 
3
3
  module Rack
4
4
  module WebSocket
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.3"
6
6
  ROOT_PATH = ::File.expand_path(::File.dirname(__FILE__))
7
7
 
8
8
  class WebSocketError < RuntimeError; end
@@ -1,6 +1,19 @@
1
1
  module Rack
2
2
  module WebSocket
3
3
  class Application
4
+
5
+ class << self
6
+ def new(*args)
7
+ if args.last == {:real_run => true}
8
+ args.shift
9
+ super(*args)
10
+ else
11
+ proc do |env|
12
+ self.new(*(args << {:real_run => true})).call(env)
13
+ end
14
+ end
15
+ end
16
+ end
4
17
 
5
18
  DEFAULT_OPTIONS = {}
6
19
  attr_accessor :options
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websocket-rack
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
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: 2011-03-08 00:00:00 +01:00
18
+ date: 2011-03-12 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency