sinatra-rocketio-linda 0.0.5 → 0.0.6
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 +4 -4
- data/History.txt +4 -0
- data/lib/sinatra-rocketio-linda/linda.rb +2 -0
- data/lib/sinatra/rocketio/linda.rb +1 -0
- data/lib/sinatra/rocketio/linda/version.rb +1 -1
- data/sample/main.rb +16 -4
- data/sinatra-rocketio-linda.gemspec +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3edaf3542a808465b17d39e554bdf5321737dcd5
|
4
|
+
data.tar.gz: 8eaad6421592d499c941f4fce900aac50172c617
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd936f5a91b10b98ddb2f753c2a40a61a50ca1b816ab44c9ae81790185d344a50f64177eaf20e357c19f5b6651b039dd53bda4d09f170aeed6abd3f0b3ed4982
|
7
|
+
data.tar.gz: cbcf2094ea503574097b95c13adaf8c909ebac2d3e61d5eb580c5cbbd9b7fac698eb360980b17ddcf4dae2aa08c8d2ec5344e0aa0cf3b47723daf9e74ee23311
|
data/History.txt
CHANGED
@@ -45,6 +45,7 @@ Sinatra::RocketIO.on :__linda_write do |data, client|
|
|
45
45
|
opts = opts_
|
46
46
|
end
|
47
47
|
Sinatra::RocketIO::Linda[space].write tuple, opts
|
48
|
+
Sinatra::RocketIO::Linda.emit :write, Hashie::Mash.new(:space => space, :tuple => tuple), client
|
48
49
|
end
|
49
50
|
|
50
51
|
[:read, :take, :watch].each do |func|
|
@@ -61,6 +62,7 @@ end
|
|
61
62
|
end
|
62
63
|
eid = Sinatra::RocketIO::Linda[space].__send__ func, tuple do |tuple|
|
63
64
|
Sinatra::RocketIO.push "__linda_#{func}_callback_#{callback}", tuple, :to => client.session
|
65
|
+
Sinatra::RocketIO::Linda.emit func, Hashie::Mash.new(:space => space, :tuple => tuple), client
|
64
66
|
end
|
65
67
|
Sinatra::RocketIO.on :disconnect do |_client|
|
66
68
|
Sinatra::RocketIO::Linda[space].remove_callback eid if client.session == _client.session
|
data/sample/main.rb
CHANGED
@@ -9,10 +9,6 @@ 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
|
-
|
16
12
|
linda.on :error do |err|
|
17
13
|
STDERR.puts err
|
18
14
|
end
|
@@ -28,3 +24,19 @@ end
|
|
28
24
|
get '/client' do
|
29
25
|
haml :client
|
30
26
|
end
|
27
|
+
|
28
|
+
linda.on :write do |tuple, client|
|
29
|
+
puts "write #{tuple.tuple} in <#{tuple.space}> by <#{client}>"
|
30
|
+
end
|
31
|
+
|
32
|
+
linda.on :read do |tuple, client|
|
33
|
+
puts "read #{tuple.tuple} in <#{tuple.space}> by <#{client}>"
|
34
|
+
end
|
35
|
+
|
36
|
+
linda.on :take do |tuple, client|
|
37
|
+
puts "take #{tuple.tuple} in <#{tuple.space}> by <#{client}>"
|
38
|
+
end
|
39
|
+
|
40
|
+
linda.on :watch do |tuple, client|
|
41
|
+
puts "watch #{tuple.tuple} in <#{tuple.space}> by <#{client}>"
|
42
|
+
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
|
+
version: 0.0.6
|
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-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: hashie
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: sinatra-rocketio
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -211,3 +225,4 @@ test_files:
|
|
211
225
|
- test/test_rubyclient.rb
|
212
226
|
- test/test_tuple.rb
|
213
227
|
- test/test_tuplespace.rb
|
228
|
+
has_rdoc:
|