juno 0.2.8 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ require 'helper'
3
3
 
4
4
  describe_juno "adapter_cassandra" do
5
5
  def new_store
6
- Juno::Adapters::Cassandra.new
6
+ Juno::Adapters::Cassandra.new(:keyspace => 'adapter_cassandra')
7
7
  end
8
8
 
9
9
  include_context 'setup_store'
@@ -0,0 +1,13 @@
1
+ # Generated by generate.rb
2
+ require 'helper'
3
+
4
+ describe_juno "adapter_leveldb" do
5
+ def new_store
6
+ Juno::Adapters::LevelDB.new(:dir => File.join(make_tempdir, "adapter_leveldb"))
7
+ end
8
+
9
+ include_context 'setup_store'
10
+ it_should_behave_like 'null_stringkey_stringvalue'
11
+ it_should_behave_like 'store_stringkey_stringvalue'
12
+ it_should_behave_like 'returndifferent_stringkey_stringvalue'
13
+ end
@@ -3,7 +3,7 @@ require 'helper'
3
3
 
4
4
  describe_juno "simple_cassandra" do
5
5
  def new_store
6
- Juno.new(:Cassandra, :logger => {:out => File.open(File.join(make_tempdir, 'simple_cassandra.log'), 'a')})
6
+ Juno.new(:Cassandra, :keyspace => "simple_cassandra", :logger => {:out => File.open(File.join(make_tempdir, 'simple_cassandra.log'), 'a')})
7
7
  end
8
8
 
9
9
  include_context 'setup_store'
@@ -0,0 +1,38 @@
1
+ # Generated by generate.rb
2
+ require 'helper'
3
+
4
+ describe_juno "simple_leveldb" do
5
+ def new_store
6
+ Juno.new(:LevelDB, :dir => File.join(make_tempdir, "simple_leveldb"), :logger => {:out => File.open(File.join(make_tempdir, 'simple_leveldb.log'), 'a')})
7
+ end
8
+
9
+ include_context 'setup_store'
10
+ it_should_behave_like 'null_objectkey_objectvalue'
11
+ it_should_behave_like 'null_objectkey_stringvalue'
12
+ it_should_behave_like 'null_objectkey_hashvalue'
13
+ it_should_behave_like 'null_stringkey_objectvalue'
14
+ it_should_behave_like 'null_stringkey_stringvalue'
15
+ it_should_behave_like 'null_stringkey_hashvalue'
16
+ it_should_behave_like 'null_hashkey_objectvalue'
17
+ it_should_behave_like 'null_hashkey_stringvalue'
18
+ it_should_behave_like 'null_hashkey_hashvalue'
19
+ it_should_behave_like 'store_objectkey_objectvalue'
20
+ it_should_behave_like 'store_objectkey_stringvalue'
21
+ it_should_behave_like 'store_objectkey_hashvalue'
22
+ it_should_behave_like 'store_stringkey_objectvalue'
23
+ it_should_behave_like 'store_stringkey_stringvalue'
24
+ it_should_behave_like 'store_stringkey_hashvalue'
25
+ it_should_behave_like 'store_hashkey_objectvalue'
26
+ it_should_behave_like 'store_hashkey_stringvalue'
27
+ it_should_behave_like 'store_hashkey_hashvalue'
28
+ it_should_behave_like 'returndifferent_objectkey_objectvalue'
29
+ it_should_behave_like 'returndifferent_objectkey_stringvalue'
30
+ it_should_behave_like 'returndifferent_objectkey_hashvalue'
31
+ it_should_behave_like 'returndifferent_stringkey_objectvalue'
32
+ it_should_behave_like 'returndifferent_stringkey_stringvalue'
33
+ it_should_behave_like 'returndifferent_stringkey_hashvalue'
34
+ it_should_behave_like 'returndifferent_hashkey_objectvalue'
35
+ it_should_behave_like 'returndifferent_hashkey_stringvalue'
36
+ it_should_behave_like 'returndifferent_hashkey_hashvalue'
37
+ it_should_behave_like 'marshallable_key'
38
+ end
@@ -0,0 +1,39 @@
1
+ # Generated by generate.rb
2
+ require 'helper'
3
+
4
+ describe_juno "simple_leveldb_with_expires" do
5
+ def new_store
6
+ Juno.new(:LevelDB, :dir => File.join(make_tempdir, "simple_leveldb_with_expires"), :expires => true, :logger => {:out => File.open(File.join(make_tempdir, 'simple_leveldb_with_expires.log'), 'a')})
7
+ end
8
+
9
+ include_context 'setup_store'
10
+ it_should_behave_like 'null_objectkey_objectvalue'
11
+ it_should_behave_like 'null_objectkey_stringvalue'
12
+ it_should_behave_like 'null_objectkey_hashvalue'
13
+ it_should_behave_like 'null_stringkey_objectvalue'
14
+ it_should_behave_like 'null_stringkey_stringvalue'
15
+ it_should_behave_like 'null_stringkey_hashvalue'
16
+ it_should_behave_like 'null_hashkey_objectvalue'
17
+ it_should_behave_like 'null_hashkey_stringvalue'
18
+ it_should_behave_like 'null_hashkey_hashvalue'
19
+ it_should_behave_like 'store_objectkey_objectvalue'
20
+ it_should_behave_like 'store_objectkey_stringvalue'
21
+ it_should_behave_like 'store_objectkey_hashvalue'
22
+ it_should_behave_like 'store_stringkey_objectvalue'
23
+ it_should_behave_like 'store_stringkey_stringvalue'
24
+ it_should_behave_like 'store_stringkey_hashvalue'
25
+ it_should_behave_like 'store_hashkey_objectvalue'
26
+ it_should_behave_like 'store_hashkey_stringvalue'
27
+ it_should_behave_like 'store_hashkey_hashvalue'
28
+ it_should_behave_like 'returndifferent_objectkey_objectvalue'
29
+ it_should_behave_like 'returndifferent_objectkey_stringvalue'
30
+ it_should_behave_like 'returndifferent_objectkey_hashvalue'
31
+ it_should_behave_like 'returndifferent_stringkey_objectvalue'
32
+ it_should_behave_like 'returndifferent_stringkey_stringvalue'
33
+ it_should_behave_like 'returndifferent_stringkey_hashvalue'
34
+ it_should_behave_like 'returndifferent_hashkey_objectvalue'
35
+ it_should_behave_like 'returndifferent_hashkey_stringvalue'
36
+ it_should_behave_like 'returndifferent_hashkey_hashvalue'
37
+ it_should_behave_like 'marshallable_key'
38
+ it_should_behave_like 'expires_stringkey_stringvalue'
39
+ end
@@ -0,0 +1,41 @@
1
+ # Generated by generate.rb
2
+ require 'helper'
3
+
4
+ describe_juno "transformer_marshal_hmac" do
5
+ def new_store
6
+ Juno.build do
7
+ use :Transformer, :key => :marshal, :value => [:marshal, :hmac], :secret => 'secret'
8
+ adapter :Memory
9
+ end
10
+ end
11
+
12
+ include_context 'setup_store'
13
+ it_should_behave_like 'null_objectkey_objectvalue'
14
+ it_should_behave_like 'null_objectkey_stringvalue'
15
+ it_should_behave_like 'null_objectkey_hashvalue'
16
+ it_should_behave_like 'null_stringkey_objectvalue'
17
+ it_should_behave_like 'null_stringkey_stringvalue'
18
+ it_should_behave_like 'null_stringkey_hashvalue'
19
+ it_should_behave_like 'null_hashkey_objectvalue'
20
+ it_should_behave_like 'null_hashkey_stringvalue'
21
+ it_should_behave_like 'null_hashkey_hashvalue'
22
+ it_should_behave_like 'store_objectkey_objectvalue'
23
+ it_should_behave_like 'store_objectkey_stringvalue'
24
+ it_should_behave_like 'store_objectkey_hashvalue'
25
+ it_should_behave_like 'store_stringkey_objectvalue'
26
+ it_should_behave_like 'store_stringkey_stringvalue'
27
+ it_should_behave_like 'store_stringkey_hashvalue'
28
+ it_should_behave_like 'store_hashkey_objectvalue'
29
+ it_should_behave_like 'store_hashkey_stringvalue'
30
+ it_should_behave_like 'store_hashkey_hashvalue'
31
+ it_should_behave_like 'returndifferent_objectkey_objectvalue'
32
+ it_should_behave_like 'returndifferent_objectkey_stringvalue'
33
+ it_should_behave_like 'returndifferent_objectkey_hashvalue'
34
+ it_should_behave_like 'returndifferent_stringkey_objectvalue'
35
+ it_should_behave_like 'returndifferent_stringkey_stringvalue'
36
+ it_should_behave_like 'returndifferent_stringkey_hashvalue'
37
+ it_should_behave_like 'returndifferent_hashkey_objectvalue'
38
+ it_should_behave_like 'returndifferent_hashkey_stringvalue'
39
+ it_should_behave_like 'returndifferent_hashkey_hashvalue'
40
+ it_should_behave_like 'marshallable_key'
41
+ end
data/spec/junospecs.rb CHANGED
@@ -45,7 +45,8 @@ shared_examples_for 'null_stringkey_stringvalue' do
45
45
  it 'should accept options' do
46
46
  store.key?("strkey1", :option1 => 1).should == false
47
47
  store.load("strkey1", :option2 => 2).should == nil
48
- store.fetch("strkey1", nil, :option3 => 3).should == nil
48
+ store.fetch("strkey1", 42, :option3 => 3).should == 42
49
+ store.fetch("strkey1", :option3 => 3) { 42 }.should == 42
49
50
  store.delete("strkey1", :option4 => 4).should == nil
50
51
  store.clear(:option5 => 5).should equal(store)
51
52
  store.store("strkey1", "strval1", :option6 => 6).should == "strval1"
@@ -218,7 +219,8 @@ shared_examples_for 'null_stringkey_objectvalue' do
218
219
  it 'should accept options' do
219
220
  store.key?("strkey1", :option1 => 1).should == false
220
221
  store.load("strkey1", :option2 => 2).should == nil
221
- store.fetch("strkey1", nil, :option3 => 3).should == nil
222
+ store.fetch("strkey1", 42, :option3 => 3).should == 42
223
+ store.fetch("strkey1", :option3 => 3) { 42 }.should == 42
222
224
  store.delete("strkey1", :option4 => 4).should == nil
223
225
  store.clear(:option5 => 5).should equal(store)
224
226
  store.store("strkey1", Value.new(:objval1), :option6 => 6).should == Value.new(:objval1)
@@ -391,7 +393,8 @@ shared_examples_for 'null_stringkey_hashvalue' do
391
393
  it 'should accept options' do
392
394
  store.key?("strkey1", :option1 => 1).should == false
393
395
  store.load("strkey1", :option2 => 2).should == nil
394
- store.fetch("strkey1", nil, :option3 => 3).should == nil
396
+ store.fetch("strkey1", 42, :option3 => 3).should == 42
397
+ store.fetch("strkey1", :option3 => 3) { 42 }.should == 42
395
398
  store.delete("strkey1", :option4 => 4).should == nil
396
399
  store.clear(:option5 => 5).should equal(store)
397
400
  store.store("strkey1", {"hashval1"=>"hashval2"}, :option6 => 6).should == {"hashval1"=>"hashval2"}
@@ -564,7 +567,8 @@ shared_examples_for 'null_objectkey_stringvalue' do
564
567
  it 'should accept options' do
565
568
  store.key?(Value.new(:objkey1), :option1 => 1).should == false
566
569
  store.load(Value.new(:objkey1), :option2 => 2).should == nil
567
- store.fetch(Value.new(:objkey1), nil, :option3 => 3).should == nil
570
+ store.fetch(Value.new(:objkey1), 42, :option3 => 3).should == 42
571
+ store.fetch(Value.new(:objkey1), :option3 => 3) { 42 }.should == 42
568
572
  store.delete(Value.new(:objkey1), :option4 => 4).should == nil
569
573
  store.clear(:option5 => 5).should equal(store)
570
574
  store.store(Value.new(:objkey1), "strval1", :option6 => 6).should == "strval1"
@@ -737,7 +741,8 @@ shared_examples_for 'null_objectkey_objectvalue' do
737
741
  it 'should accept options' do
738
742
  store.key?(Value.new(:objkey1), :option1 => 1).should == false
739
743
  store.load(Value.new(:objkey1), :option2 => 2).should == nil
740
- store.fetch(Value.new(:objkey1), nil, :option3 => 3).should == nil
744
+ store.fetch(Value.new(:objkey1), 42, :option3 => 3).should == 42
745
+ store.fetch(Value.new(:objkey1), :option3 => 3) { 42 }.should == 42
741
746
  store.delete(Value.new(:objkey1), :option4 => 4).should == nil
742
747
  store.clear(:option5 => 5).should equal(store)
743
748
  store.store(Value.new(:objkey1), Value.new(:objval1), :option6 => 6).should == Value.new(:objval1)
@@ -910,7 +915,8 @@ shared_examples_for 'null_objectkey_hashvalue' do
910
915
  it 'should accept options' do
911
916
  store.key?(Value.new(:objkey1), :option1 => 1).should == false
912
917
  store.load(Value.new(:objkey1), :option2 => 2).should == nil
913
- store.fetch(Value.new(:objkey1), nil, :option3 => 3).should == nil
918
+ store.fetch(Value.new(:objkey1), 42, :option3 => 3).should == 42
919
+ store.fetch(Value.new(:objkey1), :option3 => 3) { 42 }.should == 42
914
920
  store.delete(Value.new(:objkey1), :option4 => 4).should == nil
915
921
  store.clear(:option5 => 5).should equal(store)
916
922
  store.store(Value.new(:objkey1), {"hashval1"=>"hashval2"}, :option6 => 6).should == {"hashval1"=>"hashval2"}
@@ -1083,7 +1089,8 @@ shared_examples_for 'null_hashkey_stringvalue' do
1083
1089
  it 'should accept options' do
1084
1090
  store.key?({"hashkey1"=>"hashkey2"}, :option1 => 1).should == false
1085
1091
  store.load({"hashkey1"=>"hashkey2"}, :option2 => 2).should == nil
1086
- store.fetch({"hashkey1"=>"hashkey2"}, nil, :option3 => 3).should == nil
1092
+ store.fetch({"hashkey1"=>"hashkey2"}, 42, :option3 => 3).should == 42
1093
+ store.fetch({"hashkey1"=>"hashkey2"}, :option3 => 3) { 42 }.should == 42
1087
1094
  store.delete({"hashkey1"=>"hashkey2"}, :option4 => 4).should == nil
1088
1095
  store.clear(:option5 => 5).should equal(store)
1089
1096
  store.store({"hashkey1"=>"hashkey2"}, "strval1", :option6 => 6).should == "strval1"
@@ -1256,7 +1263,8 @@ shared_examples_for 'null_hashkey_objectvalue' do
1256
1263
  it 'should accept options' do
1257
1264
  store.key?({"hashkey1"=>"hashkey2"}, :option1 => 1).should == false
1258
1265
  store.load({"hashkey1"=>"hashkey2"}, :option2 => 2).should == nil
1259
- store.fetch({"hashkey1"=>"hashkey2"}, nil, :option3 => 3).should == nil
1266
+ store.fetch({"hashkey1"=>"hashkey2"}, 42, :option3 => 3).should == 42
1267
+ store.fetch({"hashkey1"=>"hashkey2"}, :option3 => 3) { 42 }.should == 42
1260
1268
  store.delete({"hashkey1"=>"hashkey2"}, :option4 => 4).should == nil
1261
1269
  store.clear(:option5 => 5).should equal(store)
1262
1270
  store.store({"hashkey1"=>"hashkey2"}, Value.new(:objval1), :option6 => 6).should == Value.new(:objval1)
@@ -1429,7 +1437,8 @@ shared_examples_for 'null_hashkey_hashvalue' do
1429
1437
  it 'should accept options' do
1430
1438
  store.key?({"hashkey1"=>"hashkey2"}, :option1 => 1).should == false
1431
1439
  store.load({"hashkey1"=>"hashkey2"}, :option2 => 2).should == nil
1432
- store.fetch({"hashkey1"=>"hashkey2"}, nil, :option3 => 3).should == nil
1440
+ store.fetch({"hashkey1"=>"hashkey2"}, 42, :option3 => 3).should == 42
1441
+ store.fetch({"hashkey1"=>"hashkey2"}, :option3 => 3) { 42 }.should == 42
1433
1442
  store.delete({"hashkey1"=>"hashkey2"}, :option4 => 4).should == nil
1434
1443
  store.clear(:option5 => 5).should equal(store)
1435
1444
  store.store({"hashkey1"=>"hashkey2"}, {"hashval1"=>"hashval2"}, :option6 => 6).should == {"hashval1"=>"hashval2"}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: juno
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-12-15 00:00:00.000000000 Z
13
+ date: 2012-12-18 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: A unified interface to key/value stores (moneta replacement)
16
16
  email:
@@ -42,6 +42,7 @@ files:
42
42
  - lib/juno/adapters/file.rb
43
43
  - lib/juno/adapters/fog.rb
44
44
  - lib/juno/adapters/gdbm.rb
45
+ - lib/juno/adapters/leveldb.rb
45
46
  - lib/juno/adapters/localmemcache.rb
46
47
  - lib/juno/adapters/lruhash.rb
47
48
  - lib/juno/adapters/memcached.rb
@@ -82,6 +83,7 @@ files:
82
83
  - spec/juno/adapter_file_spec.rb
83
84
  - spec/juno/adapter_fog_spec.rb
84
85
  - spec/juno/adapter_gdbm_spec.rb
86
+ - spec/juno/adapter_leveldb_spec.rb
85
87
  - spec/juno/adapter_localmemcache_spec.rb
86
88
  - spec/juno/adapter_lruhash_spec.rb
87
89
  - spec/juno/adapter_memcached_dalli_spec.rb
@@ -124,6 +126,8 @@ files:
124
126
  - spec/juno/simple_gdbm_with_expires_spec.rb
125
127
  - spec/juno/simple_hashfile_spec.rb
126
128
  - spec/juno/simple_hashfile_with_expires_spec.rb
129
+ - spec/juno/simple_leveldb_spec.rb
130
+ - spec/juno/simple_leveldb_with_expires_spec.rb
127
131
  - spec/juno/simple_localmemcache_spec.rb
128
132
  - spec/juno/simple_localmemcache_with_expires_spec.rb
129
133
  - spec/juno/simple_lruhash_spec.rb
@@ -168,6 +172,7 @@ files:
168
172
  - spec/juno/transformer_lzo_spec.rb
169
173
  - spec/juno/transformer_marshal_base64_spec.rb
170
174
  - spec/juno/transformer_marshal_escape_spec.rb
175
+ - spec/juno/transformer_marshal_hmac_spec.rb
171
176
  - spec/juno/transformer_marshal_md5_spec.rb
172
177
  - spec/juno/transformer_marshal_md5_spread_spec.rb
173
178
  - spec/juno/transformer_marshal_prefix_spec.rb
@@ -225,6 +230,7 @@ test_files:
225
230
  - spec/juno/adapter_file_spec.rb
226
231
  - spec/juno/adapter_fog_spec.rb
227
232
  - spec/juno/adapter_gdbm_spec.rb
233
+ - spec/juno/adapter_leveldb_spec.rb
228
234
  - spec/juno/adapter_localmemcache_spec.rb
229
235
  - spec/juno/adapter_lruhash_spec.rb
230
236
  - spec/juno/adapter_memcached_dalli_spec.rb
@@ -267,6 +273,8 @@ test_files:
267
273
  - spec/juno/simple_gdbm_with_expires_spec.rb
268
274
  - spec/juno/simple_hashfile_spec.rb
269
275
  - spec/juno/simple_hashfile_with_expires_spec.rb
276
+ - spec/juno/simple_leveldb_spec.rb
277
+ - spec/juno/simple_leveldb_with_expires_spec.rb
270
278
  - spec/juno/simple_localmemcache_spec.rb
271
279
  - spec/juno/simple_localmemcache_with_expires_spec.rb
272
280
  - spec/juno/simple_lruhash_spec.rb
@@ -311,6 +319,7 @@ test_files:
311
319
  - spec/juno/transformer_lzo_spec.rb
312
320
  - spec/juno/transformer_marshal_base64_spec.rb
313
321
  - spec/juno/transformer_marshal_escape_spec.rb
322
+ - spec/juno/transformer_marshal_hmac_spec.rb
314
323
  - spec/juno/transformer_marshal_md5_spec.rb
315
324
  - spec/juno/transformer_marshal_md5_spread_spec.rb
316
325
  - spec/juno/transformer_marshal_prefix_spec.rb