sinatra-rocketio-linda 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bd0f0169cf2d5ffbd3ddb33d57c714f2c4cc60c
4
- data.tar.gz: 009f53e47103bc7f183cc73c8e957467e097ca61
3
+ metadata.gz: 4f961baf37e6d4b33c7d5efdb8b20bd6c1d5eb97
4
+ data.tar.gz: 2c484ead40fc4246964fe2dc16528edf1e063d13
5
5
  SHA512:
6
- metadata.gz: 8d6d37b957f7a54c21ce502c157c507cbb22f47954b290463784996c72bae67bc72ed3662d94bb7c923c8bba0faad0d3e7a6e1993acb343115f877d5519f6807
7
- data.tar.gz: 2081757894b6210a146fbd42b0b997664076b4cd2d04ce26e76fb1cbcdda6405cf88e04e560cbb05ed1b61d7930701cf3a2b9daeeb516c809b4a6bdbf83e48b4
6
+ metadata.gz: 124abdcece62bcfd64717082315224741138fdc8fa689b8ce89981353f27cfdb8e603d5070c56fa31e407f8ea2fdf1f9f0ef88a3da02c676baa7a3b81533e7d8
7
+ data.tar.gz: 969ace1dbde8e3c8ef73a34b7fe51915920969af0e27907386ded1d8eefbb9a56aca59dac3ac2a2f27b2369d3b5101396256e0d6b97d66c3d7bcdf7565bb1e94
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 0.0.5 2013-05-20
2
+
3
+ * include rocketio_js into linda_js
4
+ * passed all tests
5
+
1
6
  === 0.0.4 2013-05-19
2
7
 
3
8
  * move Tuple/TupleSpace code to linda gem (https://rubygems.org/gems/linda)
data/README.md CHANGED
@@ -66,7 +66,6 @@ Client Side
66
66
 
67
67
  ```html
68
68
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
69
- <script src="<%= rocketio_js %>"></script>
70
69
  <script src="<%= linda_js %>"></script>
71
70
  ```
72
71
 
@@ -3,12 +3,19 @@ module Sinatra
3
3
  module Linda
4
4
 
5
5
  def self.javascript(*js_file_names)
6
- js_file_names = ['linda.js']
6
+ js_file_names = ['rocketio.js', 'linda.js']
7
7
  js = ''
8
8
  js_file_names.each do |i|
9
- File.open(File.expand_path "../js/#{i}", File.dirname(__FILE__)) do |f|
10
- js += f.read+"\n"
11
- end
9
+ js += case i
10
+ when 'rocketio.js'
11
+ Sinatra::RocketIO.javascript
12
+ else
13
+ j = ''
14
+ File.open(File.expand_path "../js/#{i}", File.dirname(__FILE__)) do |f|
15
+ j = f.read
16
+ end
17
+ j
18
+ end + "\n"
12
19
  end
13
20
  js
14
21
  end
@@ -60,7 +60,7 @@ end
60
60
  next
61
61
  end
62
62
  eid = Sinatra::RocketIO::Linda[space].__send__ func, tuple do |tuple|
63
- Sinatra::RocketIO.push "__linda_#{func}_callback_#{callback}", tuple.data, :to => client.session
63
+ Sinatra::RocketIO.push "__linda_#{func}_callback_#{callback}", tuple, :to => client.session
64
64
  end
65
65
  Sinatra::RocketIO.on :disconnect do |_client|
66
66
  Sinatra::RocketIO::Linda[space].remove_callback eid if client.session == _client.session
@@ -1,7 +1,7 @@
1
1
  module Sinatra
2
2
  module RocketIO
3
3
  module Linda
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
6
6
  end
7
7
  end
data/sample/main.rb CHANGED
@@ -9,6 +9,10 @@ io.on :disconnect do |client|
9
9
  puts "bye <#{client}>"
10
10
  end
11
11
 
12
+ io.on :* do |event, data, client|
13
+ puts "#{event} - #{data} <#{client}>" if event.to_s =~ /linda/
14
+ end
15
+
12
16
  linda.on :error do |err|
13
17
  STDERR.puts err
14
18
  end
@@ -4,7 +4,6 @@
4
4
  %meta{'http-equiv' => 'Content-Type', :content => 'text/html', :charset => 'UTF-8'}
5
5
  %title Linda Client on RocketIO
6
6
  %script{:src => "//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"}
7
- %script{:src => rocketio_js}
8
7
  %script{:src => linda_js}
9
8
  %script{:src => "/client.js"}
10
9
  %body
@@ -4,7 +4,6 @@
4
4
  %meta{'http-equiv' => 'Content-Type', :content => 'text/html', :charset => 'UTF-8'}
5
5
  %title Linda Worker on RocketIO
6
6
  %script{:src => "//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"}
7
- %script{:src => rocketio_js}
8
7
  %script{:src => linda_js}
9
8
  %script{:src => "/worker.js"}
10
9
  %body
@@ -110,7 +110,7 @@ class TestRubyClient < MiniTest::Test
110
110
  _tuple1 = tuple
111
111
  end
112
112
  sleep 3
113
- @client.io.push :check_expire, []
113
+ push :check_expire, nil
114
114
  ts.read ["expire",1,2] do |tuple|
115
115
  _tuple2 = tuple
116
116
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-rocketio-linda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Hashimoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-18 00:00:00.000000000 Z
11
+ date: 2013-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler