sinatra-rocketio-linda 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/README.md +0 -1
- data/lib/sinatra-rocketio-linda/javascript.rb +11 -4
- data/lib/sinatra-rocketio-linda/linda.rb +1 -1
- data/lib/sinatra/rocketio/linda/version.rb +1 -1
- data/sample/main.rb +4 -0
- data/sample/views/client.haml +0 -1
- data/sample/views/worker.haml +0 -1
- data/test/test_rubyclient.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f961baf37e6d4b33c7d5efdb8b20bd6c1d5eb97
|
4
|
+
data.tar.gz: 2c484ead40fc4246964fe2dc16528edf1e063d13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 124abdcece62bcfd64717082315224741138fdc8fa689b8ce89981353f27cfdb8e603d5070c56fa31e407f8ea2fdf1f9f0ef88a3da02c676baa7a3b81533e7d8
|
7
|
+
data.tar.gz: 969ace1dbde8e3c8ef73a34b7fe51915920969af0e27907386ded1d8eefbb9a56aca59dac3ac2a2f27b2369d3b5101396256e0d6b97d66c3d7bcdf7565bb1e94
|
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -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
|
-
|
10
|
-
|
11
|
-
|
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
|
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
|
data/sample/main.rb
CHANGED
data/sample/views/client.haml
CHANGED
@@ -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
|
data/sample/views/worker.haml
CHANGED
@@ -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
|
data/test/test_rubyclient.rb
CHANGED
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
|
+
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-
|
11
|
+
date: 2013-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|