sinatra-cometio 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/.gitignore +4 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +33 -0
- data/History.txt +3 -0
- data/Manifest.txt +30 -0
- data/PostInstall.txt +7 -0
- data/README.rdoc +71 -0
- data/Rakefile +28 -0
- data/lib/js/cometio.js +50 -0
- data/lib/sinatra-cometio.rb +3 -0
- data/lib/sinatra/application.rb +59 -0
- data/lib/sinatra/cometio.rb +16 -0
- data/sample/.gitignore +7 -0
- data/sample/Gemfile +11 -0
- data/sample/Gemfile.lock +48 -0
- data/sample/Procfile +1 -0
- data/sample/README.md +34 -0
- data/sample/bootstrap.rb +14 -0
- data/sample/config.ru +16 -0
- data/sample/controllers/css.rb +3 -0
- data/sample/controllers/main.rb +18 -0
- data/sample/helpers/helper.rb +4 -0
- data/sample/public/js/index.js +21 -0
- data/sample/views/index.haml +26 -0
- data/sample/views/main.scss +15 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/test/test_helper.rb +3 -0
- data/test/test_sinatra-cometio.rb +11 -0
- metadata +199 -0
data/.gemtest
ADDED
File without changes
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
RedCloth (4.2.9)
|
5
|
+
activesupport (2.3.14)
|
6
|
+
hoe (3.2.0)
|
7
|
+
rake (~> 0.8)
|
8
|
+
newgem (1.5.3)
|
9
|
+
RedCloth (>= 4.1.1)
|
10
|
+
activesupport (~> 2.3.4)
|
11
|
+
hoe (>= 2.4.0)
|
12
|
+
rubigen (>= 1.5.3)
|
13
|
+
syntax (>= 1.0.0)
|
14
|
+
rack (1.4.1)
|
15
|
+
rack-protection (1.2.0)
|
16
|
+
rack
|
17
|
+
rake (0.9.2.2)
|
18
|
+
rubigen (1.5.8)
|
19
|
+
activesupport (>= 2.3.5, < 3.2.0)
|
20
|
+
sinatra (1.3.3)
|
21
|
+
rack (~> 1.3, >= 1.3.6)
|
22
|
+
rack-protection (~> 1.2)
|
23
|
+
tilt (~> 1.3, >= 1.3.3)
|
24
|
+
syntax (1.0.0)
|
25
|
+
tilt (1.3.3)
|
26
|
+
|
27
|
+
PLATFORMS
|
28
|
+
ruby
|
29
|
+
|
30
|
+
DEPENDENCIES
|
31
|
+
hoe
|
32
|
+
newgem
|
33
|
+
sinatra
|
data/History.txt
ADDED
data/Manifest.txt
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
.gitignore
|
2
|
+
Gemfile
|
3
|
+
Gemfile.lock
|
4
|
+
History.txt
|
5
|
+
Manifest.txt
|
6
|
+
PostInstall.txt
|
7
|
+
README.rdoc
|
8
|
+
Rakefile
|
9
|
+
lib/js/cometio.js
|
10
|
+
lib/sinatra-cometio.rb
|
11
|
+
lib/sinatra/application.rb
|
12
|
+
lib/sinatra/cometio.rb
|
13
|
+
sample/.gitignore
|
14
|
+
sample/Gemfile
|
15
|
+
sample/Gemfile.lock
|
16
|
+
sample/Procfile
|
17
|
+
sample/README.md
|
18
|
+
sample/bootstrap.rb
|
19
|
+
sample/config.ru
|
20
|
+
sample/controllers/css.rb
|
21
|
+
sample/controllers/main.rb
|
22
|
+
sample/helpers/helper.rb
|
23
|
+
sample/public/js/index.js
|
24
|
+
sample/views/index.haml
|
25
|
+
sample/views/main.scss
|
26
|
+
script/console
|
27
|
+
script/destroy
|
28
|
+
script/generate
|
29
|
+
test/test_helper.rb
|
30
|
+
test/test_sinatra-cometio.rb
|
data/PostInstall.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
= sinatra-cometio
|
2
|
+
|
3
|
+
* http://github.com/shokai/sinatra-cometio
|
4
|
+
|
5
|
+
== INSTALL:
|
6
|
+
|
7
|
+
* gem install sinatra-cometio
|
8
|
+
|
9
|
+
== DESCRIPTION:
|
10
|
+
|
11
|
+
Node.js like Comet I/O plugin for Sinatra
|
12
|
+
|
13
|
+
== SYNOPSIS:
|
14
|
+
|
15
|
+
server
|
16
|
+
|
17
|
+
require 'sinatra'
|
18
|
+
require 'sinatra/cometio'
|
19
|
+
|
20
|
+
## echo
|
21
|
+
CometIO.on :chat do |data|
|
22
|
+
self.push :chat, data
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
client HTML
|
27
|
+
|
28
|
+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
|
29
|
+
<script src="<%= cometio_js %>"></script>
|
30
|
+
|
31
|
+
|
32
|
+
client JavaScript
|
33
|
+
|
34
|
+
var io = new CometIO().connect();
|
35
|
+
|
36
|
+
// client <-- server
|
37
|
+
io.on("chat", function(data){
|
38
|
+
consle.log(data.name+" : "+data.message);
|
39
|
+
});
|
40
|
+
|
41
|
+
// client --> server
|
42
|
+
io.push("chat", {name: "shokai", message: "hello"});
|
43
|
+
|
44
|
+
== REQUIREMENTS:
|
45
|
+
|
46
|
+
* Ruby 1.8.7+ or 1.9.2+
|
47
|
+
|
48
|
+
== LICENSE:
|
49
|
+
|
50
|
+
(The MIT License)
|
51
|
+
|
52
|
+
Copyright (c) 2012 Sho Hashimoto
|
53
|
+
|
54
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
55
|
+
a copy of this software and associated documentation files (the
|
56
|
+
'Software'), to deal in the Software without restriction, including
|
57
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
58
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
59
|
+
permit persons to whom the Software is furnished to do so, subject to
|
60
|
+
the following conditions:
|
61
|
+
|
62
|
+
The above copyright notice and this permission notice shall be
|
63
|
+
included in all copies or substantial portions of the Software.
|
64
|
+
|
65
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
66
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
67
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
68
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
69
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
70
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
71
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
gem 'hoe', '>= 3.1.0'
|
3
|
+
require 'hoe'
|
4
|
+
require 'fileutils'
|
5
|
+
require './lib/sinatra-cometio'
|
6
|
+
|
7
|
+
Hoe.plugin :newgem
|
8
|
+
# Hoe.plugin :website
|
9
|
+
# Hoe.plugin :cucumberfeatures
|
10
|
+
|
11
|
+
# Generate all the Rake tasks
|
12
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
13
|
+
$hoe = Hoe.spec 'sinatra-cometio' do
|
14
|
+
self.developer 'Sho Hashimoto', 'hashimoto@shokai.org'
|
15
|
+
self.rubyforge_name = self.name # TODO this is default value
|
16
|
+
self.extra_deps = [['sinatra','>= 1.3.3'],
|
17
|
+
['eventmachine', '>= 1.0.0'],
|
18
|
+
['sinatra-contrib', '>= 1.3.2'],
|
19
|
+
['event_emitter', '>= 0.0.7']]
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
require 'newgem/tasks'
|
24
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
25
|
+
|
26
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
27
|
+
# remove_task :default
|
28
|
+
# task :default => [:spec, :features]
|
data/lib/js/cometio.js
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
var CometIO = function(){
|
2
|
+
this.url = "<%= cometio_url %>";
|
3
|
+
var self = this;
|
4
|
+
|
5
|
+
this.push = function(type, data){
|
6
|
+
$.post(self.url, {type : type, data : data});
|
7
|
+
};
|
8
|
+
|
9
|
+
this.connect = function(){
|
10
|
+
self.get();
|
11
|
+
return self;
|
12
|
+
};
|
13
|
+
|
14
|
+
this.get = function(){
|
15
|
+
$.ajax(
|
16
|
+
{
|
17
|
+
url : self.url,
|
18
|
+
success : function(data){
|
19
|
+
if(data){
|
20
|
+
self.emit(data.type, data.data);
|
21
|
+
}
|
22
|
+
self.get();
|
23
|
+
},
|
24
|
+
error : function(req, stat, e){
|
25
|
+
setTimeout(self.get, 10000);
|
26
|
+
},
|
27
|
+
complete : function(e){
|
28
|
+
},
|
29
|
+
type : "GET",
|
30
|
+
dataType : "json",
|
31
|
+
timeout : 60000
|
32
|
+
}
|
33
|
+
);
|
34
|
+
};
|
35
|
+
|
36
|
+
this.events = new Array();
|
37
|
+
this.on = function(type, listener){
|
38
|
+
if(typeof listener === "function"){
|
39
|
+
self.events.push({type: type, listener: listener});
|
40
|
+
}
|
41
|
+
};
|
42
|
+
|
43
|
+
this.emit = function(type, data){
|
44
|
+
for(var i = 0; i < self.events.length; i++){
|
45
|
+
var e = self.events[i];
|
46
|
+
if(e.type == type) e.listener(data);
|
47
|
+
}
|
48
|
+
};
|
49
|
+
|
50
|
+
};
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Sinatra
|
2
|
+
|
3
|
+
class Application
|
4
|
+
|
5
|
+
helpers do
|
6
|
+
def cometio_js
|
7
|
+
"#{env['rack.url_scheme']}://#{env['HTTP_HOST']}#{env['SCRIPT_NAME']}/cometio/cometio.js"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
get '/cometio/cometio.js' do
|
12
|
+
content_type 'application/javascript'
|
13
|
+
@js ||= (
|
14
|
+
js = nil
|
15
|
+
File.open(File.expand_path '../js/cometio.js', File.dirname(__FILE__)) do |f|
|
16
|
+
js = f.read
|
17
|
+
end
|
18
|
+
cometio_url = "#{env['rack.url_scheme']}://#{env['HTTP_HOST']}#{env['SCRIPT_NAME']}/cometio/io"
|
19
|
+
ERB.new(js).result(binding)
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
get '/cometio/io' do
|
24
|
+
stream :keep_open do |s|
|
25
|
+
sid = CometIO.channel.subscribe do |msg|
|
26
|
+
begin
|
27
|
+
s.write msg.to_json
|
28
|
+
s.flush
|
29
|
+
s.close
|
30
|
+
rescue
|
31
|
+
s.close
|
32
|
+
end
|
33
|
+
CometIO.channel.unsubscribe sid
|
34
|
+
end
|
35
|
+
CometIO.emit :connect, sid
|
36
|
+
|
37
|
+
EM::add_timer 10 do
|
38
|
+
begin
|
39
|
+
s.write({:type => :cometio_heartbeat, :data => {:time => Time.now.to_s}}.to_json)
|
40
|
+
s.flush
|
41
|
+
s.close
|
42
|
+
rescue
|
43
|
+
s.close
|
44
|
+
end
|
45
|
+
CometIO.channel.unsubscribe sid
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
post '/cometio/io' do
|
51
|
+
type = params[:type]
|
52
|
+
data = params[:data]
|
53
|
+
CometIO.emit type, data if type.size > 0
|
54
|
+
{:type => type, :data => data}.to_json
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'event_emitter'
|
3
|
+
require 'sinatra/streaming'
|
4
|
+
require File.expand_path 'application', File.dirname(__FILE__)
|
5
|
+
require File.expand_path '../sinatra-cometio', File.dirname(__FILE__)
|
6
|
+
|
7
|
+
class CometIO
|
8
|
+
def self.channel
|
9
|
+
@@channel ||= EM::Channel.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.push(type, data)
|
13
|
+
self.channel.push :type => type, :data => data
|
14
|
+
end
|
15
|
+
end
|
16
|
+
EventEmitter.apply CometIO
|
data/sample/.gitignore
ADDED
data/sample/Gemfile
ADDED
data/sample/Gemfile.lock
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
backports (2.6.5)
|
5
|
+
daemons (1.1.9)
|
6
|
+
event_emitter (0.0.7)
|
7
|
+
eventmachine (1.0.0)
|
8
|
+
foreman (0.60.2)
|
9
|
+
thor (>= 0.13.6)
|
10
|
+
haml (3.1.7)
|
11
|
+
json (1.7.5)
|
12
|
+
rack (1.4.1)
|
13
|
+
rack-protection (1.2.0)
|
14
|
+
rack
|
15
|
+
rack-test (0.6.2)
|
16
|
+
rack (>= 1.0)
|
17
|
+
sass (3.2.3)
|
18
|
+
sinatra (1.3.3)
|
19
|
+
rack (~> 1.3, >= 1.3.6)
|
20
|
+
rack-protection (~> 1.2)
|
21
|
+
tilt (~> 1.3, >= 1.3.3)
|
22
|
+
sinatra-contrib (1.3.2)
|
23
|
+
backports (>= 2.0)
|
24
|
+
eventmachine
|
25
|
+
rack-protection
|
26
|
+
rack-test
|
27
|
+
sinatra (~> 1.3.0)
|
28
|
+
tilt (~> 1.3)
|
29
|
+
thin (1.5.0)
|
30
|
+
daemons (>= 1.0.9)
|
31
|
+
eventmachine (>= 0.12.6)
|
32
|
+
rack (>= 1.0.0)
|
33
|
+
thor (0.16.0)
|
34
|
+
tilt (1.3.3)
|
35
|
+
|
36
|
+
PLATFORMS
|
37
|
+
ruby
|
38
|
+
|
39
|
+
DEPENDENCIES
|
40
|
+
event_emitter
|
41
|
+
foreman
|
42
|
+
haml
|
43
|
+
json
|
44
|
+
rack
|
45
|
+
sass
|
46
|
+
sinatra
|
47
|
+
sinatra-contrib
|
48
|
+
thin
|
data/sample/Procfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
web: bundle exec rackup config.ru -p $PORT
|
data/sample/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
Comet Chat
|
2
|
+
==========
|
3
|
+
|
4
|
+
* Ruby 1.8.7+ or 1.9.2+
|
5
|
+
* sinatra-cometio with Sinatra1.3+
|
6
|
+
|
7
|
+
|
8
|
+
Install Dependencies
|
9
|
+
--------------------
|
10
|
+
|
11
|
+
% gem install bundler foreman
|
12
|
+
% bundle install
|
13
|
+
|
14
|
+
|
15
|
+
Run
|
16
|
+
---
|
17
|
+
|
18
|
+
% foreman start
|
19
|
+
|
20
|
+
=> http://localhost:5000
|
21
|
+
|
22
|
+
|
23
|
+
Deploy Heroku
|
24
|
+
-------------
|
25
|
+
|
26
|
+
% mkdir ~/cometio-sample
|
27
|
+
% cp -R ./ ~/cometio-sample/
|
28
|
+
% cd ~/cometio-sample
|
29
|
+
% git init
|
30
|
+
% git add ./
|
31
|
+
% git commit -m "first sample chat"
|
32
|
+
% heroku create --stack cedar
|
33
|
+
% git push heroku master
|
34
|
+
% heroku open
|
data/sample/bootstrap.rb
ADDED
data/sample/config.ru
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
Bundler.require
|
4
|
+
if development?
|
5
|
+
$stdout.sync = true
|
6
|
+
require 'sinatra/reloader'
|
7
|
+
$:.unshift File.expand_path '../lib', File.dirname(__FILE__)
|
8
|
+
end
|
9
|
+
require 'sinatra/cometio'
|
10
|
+
|
11
|
+
require File.dirname(__FILE__)+'/bootstrap'
|
12
|
+
Bootstrap.init :helpers, :controllers
|
13
|
+
|
14
|
+
set :haml, :escape_html => true
|
15
|
+
|
16
|
+
run Sinatra::Application
|
@@ -0,0 +1,18 @@
|
|
1
|
+
CometIO.on :chat do |data|
|
2
|
+
self.push :chat, data
|
3
|
+
end
|
4
|
+
|
5
|
+
CometIO.on :connect do |id|
|
6
|
+
puts "comet <#{id}> connect."
|
7
|
+
end
|
8
|
+
|
9
|
+
EM::defer do
|
10
|
+
loop do
|
11
|
+
CometIO.push :chat, :name => 'clock', :message => Time.now.to_s
|
12
|
+
sleep 60
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
get '/' do
|
17
|
+
haml :index
|
18
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
var io = new CometIO().connect();
|
2
|
+
|
3
|
+
io.on("chat", function(data){
|
4
|
+
var m = $("<li>").text(data.name + " : " +data.message);
|
5
|
+
$("#chat #timeline").prepend(m);
|
6
|
+
});
|
7
|
+
|
8
|
+
$(function(){
|
9
|
+
$("#chat #btn_send").click(post);
|
10
|
+
$("#chat #message").keydown(function(e){
|
11
|
+
if(e.keyCode == 13) post();
|
12
|
+
});
|
13
|
+
});
|
14
|
+
|
15
|
+
var post = function(){
|
16
|
+
var name = $("#chat #name").val();
|
17
|
+
var message = $("#chat #message").val();
|
18
|
+
if(message.length < 1) return;
|
19
|
+
io.push("chat", {name: name, message: message});
|
20
|
+
$("#chat #message").val("");
|
21
|
+
};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
!!! XHTML
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{'http-equiv' => 'Content-Type', :content => 'text/html', :charset => 'UTF-8'}
|
5
|
+
%title comet chat
|
6
|
+
%link{:rel => 'stylesheet', :href => "/main.css", :type => 'text/css'}
|
7
|
+
%script{:type => 'text/javascript', :src => "//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"}
|
8
|
+
- ## load cometio.js
|
9
|
+
%script{:type => 'text/javascript', :src => cometio_js}
|
10
|
+
%script{:type => 'text/javascript', :src => "/js/index.js"}
|
11
|
+
|
12
|
+
%body
|
13
|
+
%div#content
|
14
|
+
%div#header
|
15
|
+
%h1 comet chat
|
16
|
+
%div#main
|
17
|
+
%div#chat
|
18
|
+
%input{:id => 'name', :value => 'name', :size => 20}
|
19
|
+
%input{:id => 'message', :value => 'hello!!', :size => 80}
|
20
|
+
%input{:id => 'btn_send', :type => 'button', :value => 'start'}
|
21
|
+
%ul#timeline
|
22
|
+
|
23
|
+
%hr
|
24
|
+
%div#footer
|
25
|
+
- src_url = 'https://github.com/shokai/sinatra-cometio'
|
26
|
+
%a{:href => src_url} #{src_url}
|
data/script/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# File: script/console
|
3
|
+
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
+
|
5
|
+
libs = " -r irb/completion"
|
6
|
+
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
+
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
+
libs << " -r #{File.dirname(__FILE__) + '/../lib/sinatra-cometio.rb'}"
|
9
|
+
puts "Loading sinatra-cometio gem"
|
10
|
+
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/destroy'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/generate'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Generate.new.run(ARGV)
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,199 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sinatra-cometio
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Sho Hashimoto
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-11-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: sinatra
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.3.3
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.3.3
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: eventmachine
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.0.0
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.0.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: sinatra-contrib
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.3.2
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.3.2
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: event_emitter
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 0.0.7
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.0.7
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rdoc
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '3.10'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '3.10'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: newgem
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 1.5.3
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.5.3
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: hoe
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.2'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '3.2'
|
126
|
+
description: Node.js like Comet I/O plugin for Sinatra
|
127
|
+
email:
|
128
|
+
- hashimoto@shokai.org
|
129
|
+
executables: []
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files:
|
132
|
+
- History.txt
|
133
|
+
- Manifest.txt
|
134
|
+
- PostInstall.txt
|
135
|
+
- README.rdoc
|
136
|
+
files:
|
137
|
+
- .gitignore
|
138
|
+
- Gemfile
|
139
|
+
- Gemfile.lock
|
140
|
+
- History.txt
|
141
|
+
- Manifest.txt
|
142
|
+
- PostInstall.txt
|
143
|
+
- README.rdoc
|
144
|
+
- Rakefile
|
145
|
+
- lib/js/cometio.js
|
146
|
+
- lib/sinatra-cometio.rb
|
147
|
+
- lib/sinatra/application.rb
|
148
|
+
- lib/sinatra/cometio.rb
|
149
|
+
- sample/.gitignore
|
150
|
+
- sample/Gemfile
|
151
|
+
- sample/Gemfile.lock
|
152
|
+
- sample/Procfile
|
153
|
+
- sample/README.md
|
154
|
+
- sample/bootstrap.rb
|
155
|
+
- sample/config.ru
|
156
|
+
- sample/controllers/css.rb
|
157
|
+
- sample/controllers/main.rb
|
158
|
+
- sample/helpers/helper.rb
|
159
|
+
- sample/public/js/index.js
|
160
|
+
- sample/views/index.haml
|
161
|
+
- sample/views/main.scss
|
162
|
+
- script/console
|
163
|
+
- script/destroy
|
164
|
+
- script/generate
|
165
|
+
- test/test_helper.rb
|
166
|
+
- test/test_sinatra-cometio.rb
|
167
|
+
- .gemtest
|
168
|
+
homepage: http://github.com/shokai/sinatra-cometio
|
169
|
+
licenses: []
|
170
|
+
post_install_message:
|
171
|
+
rdoc_options:
|
172
|
+
- --main
|
173
|
+
- README.rdoc
|
174
|
+
require_paths:
|
175
|
+
- lib
|
176
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
178
|
+
requirements:
|
179
|
+
- - ! '>='
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
segments:
|
183
|
+
- 0
|
184
|
+
hash: -865335438881697336
|
185
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
187
|
+
requirements:
|
188
|
+
- - ! '>='
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '0'
|
191
|
+
requirements: []
|
192
|
+
rubyforge_project: sinatra-cometio
|
193
|
+
rubygems_version: 1.8.24
|
194
|
+
signing_key:
|
195
|
+
specification_version: 3
|
196
|
+
summary: Node.js like Comet I/O plugin for Sinatra
|
197
|
+
test_files:
|
198
|
+
- test/test_helper.rb
|
199
|
+
- test/test_sinatra-cometio.rb
|