linda 0.0.4 → 0.1.0

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: 222fc25528f372a65dedf1ba623a39bedb5a1611
4
- data.tar.gz: 122f6d8a6d936b20e4b39f3946c499916c7124e4
3
+ metadata.gz: c74eb80c02d45097a74820df5f4c010ff9887620
4
+ data.tar.gz: c9a78a85122f3b398578bcd86c237d66ffeddce9
5
5
  SHA512:
6
- metadata.gz: fa137ac6811892d6ffda280d7c43a821a5daee3d92f57548d065b2efb41c848f032bf5086f3953f9d6f00aabb2037e9aea841e1156dbf4a4929eabc5e012598d
7
- data.tar.gz: 682893a29a0406d0e5edc61a28f6fc879aa2214b6f2b20f0b78b9af605b1b29812d7f2bb0a8b7498775d4b2d9ef507523326bb5e85650ffbf9da455d55e93094
6
+ metadata.gz: 2e60f242a5e3211a7cfee80acf4e765e3ee44453abc23a9240872ab9a20dbccc4485b7f5cec6cbdb6b60e48fd70dd421eefb96ad17f34898f204782265415f86
7
+ data.tar.gz: 517969f5b66810cd5714f909fe4b93e989cd2e78910f284cc2abb0284233ddc646cc230fc589638b69e7986df6ddb016e358f5d93e5324b195554e950c7755c9
@@ -1,3 +1,7 @@
1
+ === 0.1.0 2013-11-19
2
+
3
+ * TupleSpace#list to get list of Tuples
4
+
1
5
  === 0.0.4 2013-05-31
2
6
 
3
7
  * TupleSpace#cancel for remove read/take/watch callback
data/README.md CHANGED
@@ -103,6 +103,11 @@ Tuple/TupleSpace Functions
103
103
  - remove read/take/watch callback by Callback-ID.
104
104
 
105
105
 
106
+ ### TupleSpace#list(tuple)
107
+
108
+ - return list(Array) of Tuples they matches in TupleSpace. return empty Array `[]` if not matches.
109
+
110
+
106
111
  Test your Linda implementation
107
112
  ------------------------------
108
113
 
@@ -196,6 +196,19 @@ module Linda
196
196
  assert callback_id1 != callback_id2
197
197
  end
198
198
 
199
+ def test_list
200
+ _tuple1 = ["a", "b", "c"]
201
+ _tuple2 = ["a", "b"]
202
+ _tuple3 = ["a", "b", "c", 123]
203
+ @space.write _tuple1
204
+ @space.write _tuple2
205
+ @space.write _tuple3
206
+ _result1 = @space.list ["a", "b", "c"]
207
+ _result2 = @space.list ["a", "b"]
208
+ assert_equal _result1.map{|i|i.data}, [_tuple3, _tuple1]
209
+ assert_equal _result2.map{|i|i.data}, [_tuple3, _tuple2, _tuple1]
210
+ end
211
+
199
212
  end
200
213
  end
201
214
  end
@@ -104,6 +104,13 @@ module Linda
104
104
  callback
105
105
  end
106
106
 
107
+ def list(tuple)
108
+ tuple = Tuple.new tuple unless kind_of? Tuple
109
+ @tuples.select do |t|
110
+ tuple.match? t
111
+ end
112
+ end
113
+
107
114
  def check_expire
108
115
  expires = []
109
116
  self.each do |tuple|
@@ -1,3 +1,3 @@
1
1
  module Linda
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
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-30 00:00:00.000000000 Z
11
+ date: 2013-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.0.3
113
+ rubygems_version: 2.1.5
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Tuple and TupleSpace implementation of Linda - coordinational language for
@@ -119,4 +119,3 @@ test_files:
119
119
  - test/test_helper.rb
120
120
  - test/test_tuple.rb
121
121
  - test/test_tuplespace.rb
122
- has_rdoc: