sinatra-cometio 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f2a85bfa87462fa70ad499c1667c9709b6b1b8c
4
- data.tar.gz: c616152d43be0b88ad5c4c8b5a78416248efffeb
3
+ metadata.gz: 46011b78d7f07c4031536b64d3670ccdc9b10063
4
+ data.tar.gz: 27dfbb11e619502f2fa05be52377896f7dc91e60
5
5
  SHA512:
6
- metadata.gz: c74e253c71ffb4f9174032ba4182aa66f05178f984d6eb2b675d30222919cfb6a11687eb0fb6bbb60dca16132e05de3bde326dc2ee5c520d2a099b14c7bc76ac
7
- data.tar.gz: ce5cef5013ebc0aa373e1a337dbfb333b4cabc4293f040facf6bc880f9ae6e9045941ba3dc8b3ff9f81ab89321da76391f871063f76baca8188de21bbfddcf34
6
+ metadata.gz: 7965c0eeb836897d74acbcfa4d376123c711046f37d506f00854471e393c033ac08ee881ee243e06cb309a81e3b152ce639f6fc7b33cfa097bdc88d56562e8c2
7
+ data.tar.gz: d88674a1b9957607e6fe8aa2f99c71f3786a7de5f8c4e69d4714ddc7b5f2b5cd049901a5848de265a37853bbc8af3459a334fb1579776c7b302e08db9000ef48
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.5.1 2013-04-03
2
+
3
+ * config post interval - "set :cometio, :post_interval => 1"
4
+
1
5
  === 0.5.0 2013-04-02
2
6
 
3
7
  * use queue javascript side push
data/README.md CHANGED
@@ -30,7 +30,7 @@ Server Side
30
30
  ```ruby
31
31
  require 'sinatra'
32
32
  require 'sinatra/cometio'
33
- set :cometio, :timeout => 120
33
+ set :cometio, :timeout => 120, :post_interval => 1
34
34
 
35
35
  run Sinatra::Application
36
36
  ```
data/lib/js/cometio.js CHANGED
@@ -30,7 +30,7 @@ var CometIO = function(){
30
30
  );
31
31
  post_queue = [];
32
32
  };
33
- setInterval(flush, 1000);
33
+ setInterval(flush, <%= (CometIO.options[:post_interval]*1000).to_i %>);
34
34
 
35
35
  this.push = function(type, data){
36
36
  if(!running || !self.session){
@@ -11,7 +11,8 @@ module Sinatra
11
11
 
12
12
  def self.default_options
13
13
  {
14
- :timeout => [120, lambda{|v| v.kind_of? Fixnum and v >= 20 }]
14
+ :timeout => [120, lambda{|v| v.kind_of? Fixnum and v >= 20 }],
15
+ :post_interval => [1, lambda{|v| [Fixnum, Float].include? v.class and v >= 1 }]
15
16
  }
16
17
  end
17
18
 
@@ -1,5 +1,5 @@
1
1
  module Sinatra
2
2
  module CometIO
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  end
data/sample/config.ru CHANGED
@@ -14,6 +14,6 @@ require 'sass'
14
14
  require File.dirname(__FILE__)+'/main'
15
15
 
16
16
  set :haml, :escape_html => true
17
- set :cometio, :timeout => 60
17
+ set :cometio, :timeout => 60, :post_interval => 2
18
18
 
19
19
  run ChatApp
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-cometio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto