sinatra-websocketio 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ === 0.1.3 2013-03-18
2
+
3
+ * require "sinatra/websocketio_nostart"
4
+
1
5
  === 0.1.2 2013-03-18
2
6
 
3
7
  * fix gem dependencies
data/README.md CHANGED
@@ -5,6 +5,7 @@ sinatra-websocketio
5
5
  * https://github.com/shokai/sinatra-websocketio
6
6
  * https://github.com/shokai/sinatra-websocketio/wiki
7
7
  * [Handle 10K+ clients on 1 process](https://github.com/shokai/sinatra-websocketio/wiki/C10K)
8
+ * This is a component of the [RocketIO](https://github.com/shokai/sinatra-rocketio)
8
9
 
9
10
 
10
11
  Installation
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module WebSocketIO
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -1,7 +1,15 @@
1
1
  module Sinatra
2
2
  module WebSocketIO
3
3
 
4
+ @@running = false
5
+ def self.running?
6
+ @@running
7
+ end
8
+
9
+
4
10
  def self.start
11
+ return if running?
12
+ @@running = true
5
13
  EM::defer do
6
14
  while !EM::reactor_running? do
7
15
  sleep 1
@@ -1,19 +1,2 @@
1
- require 'eventmachine'
2
- require 'em-websocket'
3
- require 'json'
4
- require 'digest/md5'
5
- require 'event_emitter'
6
- require 'sinatra/streaming'
7
- require File.expand_path '../sinatra-websocketio/version', File.dirname(__FILE__)
8
- require File.expand_path '../sinatra-websocketio/helpers', File.dirname(__FILE__)
9
- require File.expand_path '../sinatra-websocketio/options', File.dirname(__FILE__)
10
- require File.expand_path '../sinatra-websocketio/websocketio', File.dirname(__FILE__)
11
- require File.expand_path '../sinatra-websocketio/javascript', File.dirname(__FILE__)
12
- require File.expand_path '../sinatra-websocketio/application', File.dirname(__FILE__)
13
-
14
- module Sinatra
15
- module WebSocketIO
16
- end
17
- register WebSocketIO
18
- end
1
+ require File.expand_path 'websocketio_nostart', File.dirname(__FILE__)
19
2
  Sinatra::WebSocketIO.start
@@ -0,0 +1,18 @@
1
+ require 'eventmachine'
2
+ require 'em-websocket'
3
+ require 'json'
4
+ require 'digest/md5'
5
+ require 'event_emitter'
6
+ require 'sinatra/streaming'
7
+ require File.expand_path '../sinatra-websocketio/version', File.dirname(__FILE__)
8
+ require File.expand_path '../sinatra-websocketio/helpers', File.dirname(__FILE__)
9
+ require File.expand_path '../sinatra-websocketio/options', File.dirname(__FILE__)
10
+ require File.expand_path '../sinatra-websocketio/websocketio', File.dirname(__FILE__)
11
+ require File.expand_path '../sinatra-websocketio/javascript', File.dirname(__FILE__)
12
+ require File.expand_path '../sinatra-websocketio/application', File.dirname(__FILE__)
13
+
14
+ module Sinatra
15
+ module WebSocketIO
16
+ end
17
+ register WebSocketIO
18
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-websocketio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-17 00:00:00.000000000 Z
12
+ date: 2013-03-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -164,6 +164,7 @@ files:
164
164
  - lib/sinatra-websocketio/version.rb
165
165
  - lib/sinatra-websocketio/websocketio.rb
166
166
  - lib/sinatra/websocketio.rb
167
+ - lib/sinatra/websocketio_nostart.rb
167
168
  - sample/Gemfile
168
169
  - sample/Gemfile.lock
169
170
  - sample/Procfile