juno 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/.travis.yml +6 -0
- data/Gemfile +16 -9
- data/README.md +92 -34
- data/Rakefile +23 -5
- data/benchmarks/run.rb +19 -22
- data/juno.gemspec +0 -3
- data/lib/juno/adapters/activerecord.rb +58 -0
- data/lib/juno/adapters/cassandra.rb +47 -0
- data/lib/juno/adapters/couch.rb +43 -0
- data/lib/juno/adapters/datamapper.rb +64 -0
- data/lib/juno/adapters/dbm.rb +17 -0
- data/lib/juno/adapters/file.rb +58 -0
- data/lib/juno/adapters/fog.rb +42 -0
- data/lib/juno/adapters/gdbm.rb +17 -0
- data/lib/juno/adapters/localmemcache.rb +18 -0
- data/lib/juno/adapters/memcached.rb +11 -0
- data/lib/juno/adapters/memcached_dalli.rb +46 -0
- data/lib/juno/adapters/memcached_native.rb +47 -0
- data/lib/juno/adapters/memory.rb +30 -0
- data/lib/juno/adapters/mongo.rb +43 -0
- data/lib/juno/adapters/null.rb +28 -0
- data/lib/juno/adapters/pstore.rb +51 -0
- data/lib/juno/adapters/redis.rb +43 -0
- data/lib/juno/adapters/riak.rb +46 -0
- data/lib/juno/adapters/sdbm.rb +27 -0
- data/lib/juno/adapters/sequel.rb +50 -0
- data/lib/juno/adapters/sqlite.rb +52 -0
- data/lib/juno/adapters/tokyocabinet.rb +33 -0
- data/lib/juno/adapters/yaml.rb +13 -0
- data/lib/juno/base.rb +11 -89
- data/lib/juno/builder.rb +30 -0
- data/lib/juno/cache.rb +64 -0
- data/lib/juno/expires.rb +6 -10
- data/lib/juno/proxy.rb +62 -3
- data/lib/juno/stack.rb +27 -11
- data/lib/juno/transformer.rb +106 -0
- data/lib/juno/version.rb +1 -1
- data/lib/juno.rb +81 -29
- data/spec/adapter_activerecord_spec.rb +41 -0
- data/spec/adapter_cassandra_spec.rb +27 -0
- data/spec/adapter_couch_spec.rb +27 -0
- data/spec/adapter_datamapper_spec.rb +61 -0
- data/spec/adapter_dbm_spec.rb +27 -0
- data/spec/adapter_file_spec.rb +27 -0
- data/spec/adapter_fog_spec.rb +35 -0
- data/spec/adapter_gdbm_spec.rb +27 -0
- data/spec/adapter_localmemcache_spec.rb +27 -0
- data/spec/adapter_memcached_dalli_spec.rb +28 -0
- data/spec/adapter_memcached_native_spec.rb +28 -0
- data/spec/adapter_memcached_spec.rb +28 -0
- data/spec/adapter_memory_spec.rb +42 -0
- data/spec/adapter_mongo_spec.rb +27 -0
- data/spec/adapter_pstore_spec.rb +30 -0
- data/spec/adapter_redis_spec.rb +28 -0
- data/spec/adapter_riak_spec.rb +31 -0
- data/spec/adapter_sdbm_spec.rb +27 -0
- data/spec/adapter_sequel_spec.rb +27 -0
- data/spec/adapter_sqlite_spec.rb +27 -0
- data/spec/adapter_tokyocabinet_spec.rb +27 -0
- data/spec/adapter_yaml_spec.rb +30 -0
- data/spec/cache_file_memory_spec.rb +50 -0
- data/spec/cache_memory_null_spec.rb +39 -0
- data/spec/expires_file_spec.rb +82 -0
- data/spec/expires_memory_spec.rb +59 -0
- data/spec/generate.rb +736 -0
- data/spec/helper.rb +39 -0
- data/spec/junospecs.rb +1540 -0
- data/spec/null_adapter_spec.rb +33 -0
- data/spec/proxy_expires_memory_spec.rb +63 -0
- data/spec/proxy_redis_spec.rb +38 -0
- data/spec/simple_activerecord_spec.rb +52 -0
- data/spec/simple_cassandra_spec.rb +53 -0
- data/spec/simple_couch_spec.rb +52 -0
- data/spec/simple_datamapper_spec.rb +54 -0
- data/spec/simple_datamapper_with_repository_spec.rb +54 -0
- data/spec/simple_dbm_spec.rb +52 -0
- data/spec/simple_file_spec.rb +52 -0
- data/spec/simple_fog_spec.rb +60 -0
- data/spec/simple_gdbm_spec.rb +52 -0
- data/spec/simple_hashfile_spec.rb +52 -0
- data/spec/simple_localmemcache_spec.rb +52 -0
- data/spec/simple_memcached_dalli_spec.rb +53 -0
- data/spec/simple_memcached_native_spec.rb +53 -0
- data/spec/simple_memcached_spec.rb +53 -0
- data/spec/simple_memory_spec.rb +52 -0
- data/spec/simple_mongo_spec.rb +52 -0
- data/spec/simple_null_spec.rb +43 -0
- data/spec/simple_pstore_spec.rb +52 -0
- data/spec/simple_redis_spec.rb +53 -0
- data/spec/simple_riak_spec.rb +56 -0
- data/spec/simple_sdbm_spec.rb +52 -0
- data/spec/simple_sequel_spec.rb +52 -0
- data/spec/simple_sqlite_spec.rb +52 -0
- data/spec/simple_tokyocabinet_spec.rb +52 -0
- data/spec/simple_yaml_spec.rb +52 -0
- data/spec/stack_file_memory_spec.rb +43 -0
- data/spec/stack_memory_file_spec.rb +42 -0
- data/spec/transformer_bson_spec.rb +44 -0
- data/spec/transformer_json_spec.rb +44 -0
- data/spec/transformer_marshal_base64_spec.rb +60 -0
- data/spec/transformer_marshal_escape_spec.rb +60 -0
- data/spec/transformer_marshal_md5_spec.rb +60 -0
- data/spec/transformer_marshal_md5_spread_spec.rb +60 -0
- data/spec/transformer_msgpack_spec.rb +44 -0
- data/spec/transformer_yaml_spec.rb +59 -0
- metadata +164 -108
- data/lib/juno/activerecord.rb +0 -55
- data/lib/juno/cassandra.rb +0 -45
- data/lib/juno/couch.rb +0 -43
- data/lib/juno/datamapper.rb +0 -63
- data/lib/juno/dbm.rb +0 -15
- data/lib/juno/file.rb +0 -62
- data/lib/juno/fog.rb +0 -48
- data/lib/juno/gdbm.rb +0 -15
- data/lib/juno/hashfile.rb +0 -12
- data/lib/juno/localmemcache.rb +0 -16
- data/lib/juno/memcached.rb +0 -7
- data/lib/juno/memcached_dalli.rb +0 -55
- data/lib/juno/memcached_native.rb +0 -56
- data/lib/juno/memory.rb +0 -7
- data/lib/juno/mongodb.rb +0 -43
- data/lib/juno/null.rb +0 -23
- data/lib/juno/pstore.rb +0 -49
- data/lib/juno/redis.rb +0 -46
- data/lib/juno/riak.rb +0 -45
- data/lib/juno/sdbm.rb +0 -15
- data/lib/juno/sequel.rb +0 -48
- data/lib/juno/sqlite.rb +0 -50
- data/lib/juno/tokyocabinet.rb +0 -36
- data/lib/juno/yaml.rb +0 -9
- data/test/helper.rb +0 -212
- data/test/test_activerecord.rb +0 -33
- data/test/test_cassandra.rb +0 -13
- data/test/test_couch.rb +0 -13
- data/test/test_datamapper.rb +0 -64
- data/test/test_dbm.rb +0 -13
- data/test/test_expires.rb +0 -9
- data/test/test_file.rb +0 -9
- data/test/test_fog.rb +0 -17
- data/test/test_gdbm.rb +0 -13
- data/test/test_hashfile.rb +0 -9
- data/test/test_localmemcache.rb +0 -13
- data/test/test_memcached.rb +0 -14
- data/test/test_memcached_dalli.rb +0 -14
- data/test/test_memcached_native.rb +0 -14
- data/test/test_memory.rb +0 -9
- data/test/test_mongodb.rb +0 -13
- data/test/test_null.rb +0 -9
- data/test/test_proxy.rb +0 -9
- data/test/test_pstore.rb +0 -9
- data/test/test_redis.rb +0 -13
- data/test/test_riak.rb +0 -13
- data/test/test_sdbm.rb +0 -13
- data/test/test_sequel.rb +0 -13
- data/test/test_sqlite.rb +0 -13
- data/test/test_stack.rb +0 -10
- data/test/test_tokyocabinet.rb +0 -13
- data/test/test_yaml.rb +0 -9
- data/unsupported/test_tokyotyrant.rb +0 -13
- data/unsupported/tokyotyrant.rb +0 -29
@@ -0,0 +1,82 @@
|
|
1
|
+
# Generated file
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
begin
|
5
|
+
|
6
|
+
Juno.build do
|
7
|
+
use :Expires
|
8
|
+
use :Transformer, :key => [:marshal, :escape], :value => :marshal
|
9
|
+
adapter :File, :dir => File.join(make_tempdir, "expires-file")
|
10
|
+
end.close
|
11
|
+
|
12
|
+
describe "expires_file" do
|
13
|
+
before do
|
14
|
+
@store =
|
15
|
+
Juno.build do
|
16
|
+
use :Expires
|
17
|
+
use :Transformer, :key => [:marshal, :escape], :value => :marshal
|
18
|
+
adapter :File, :dir => File.join(make_tempdir, "expires-file")
|
19
|
+
end
|
20
|
+
@store.clear
|
21
|
+
end
|
22
|
+
|
23
|
+
after do
|
24
|
+
@store.close.should == nil if @store
|
25
|
+
end
|
26
|
+
|
27
|
+
it_should_behave_like 'null_objectkey_objectvalue'
|
28
|
+
it_should_behave_like 'null_objectkey_stringvalue'
|
29
|
+
it_should_behave_like 'null_objectkey_hashvalue'
|
30
|
+
it_should_behave_like 'null_stringkey_objectvalue'
|
31
|
+
it_should_behave_like 'null_stringkey_stringvalue'
|
32
|
+
it_should_behave_like 'null_stringkey_hashvalue'
|
33
|
+
it_should_behave_like 'null_hashkey_objectvalue'
|
34
|
+
it_should_behave_like 'null_hashkey_stringvalue'
|
35
|
+
it_should_behave_like 'null_hashkey_hashvalue'
|
36
|
+
it_should_behave_like 'store_objectkey_objectvalue'
|
37
|
+
it_should_behave_like 'store_objectkey_stringvalue'
|
38
|
+
it_should_behave_like 'store_objectkey_hashvalue'
|
39
|
+
it_should_behave_like 'store_stringkey_objectvalue'
|
40
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
41
|
+
it_should_behave_like 'store_stringkey_hashvalue'
|
42
|
+
it_should_behave_like 'store_hashkey_objectvalue'
|
43
|
+
it_should_behave_like 'store_hashkey_stringvalue'
|
44
|
+
it_should_behave_like 'store_hashkey_hashvalue'
|
45
|
+
it_should_behave_like 'expires_objectkey_objectvalue'
|
46
|
+
it_should_behave_like 'expires_objectkey_stringvalue'
|
47
|
+
it_should_behave_like 'expires_objectkey_hashvalue'
|
48
|
+
it_should_behave_like 'expires_stringkey_objectvalue'
|
49
|
+
it_should_behave_like 'expires_stringkey_stringvalue'
|
50
|
+
it_should_behave_like 'expires_stringkey_hashvalue'
|
51
|
+
it_should_behave_like 'expires_hashkey_objectvalue'
|
52
|
+
it_should_behave_like 'expires_hashkey_stringvalue'
|
53
|
+
it_should_behave_like 'expires_hashkey_hashvalue'
|
54
|
+
it_should_behave_like 'returndifferent_objectkey_objectvalue'
|
55
|
+
it_should_behave_like 'returndifferent_objectkey_stringvalue'
|
56
|
+
it_should_behave_like 'returndifferent_objectkey_hashvalue'
|
57
|
+
it_should_behave_like 'returndifferent_stringkey_objectvalue'
|
58
|
+
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
59
|
+
it_should_behave_like 'returndifferent_stringkey_hashvalue'
|
60
|
+
it_should_behave_like 'returndifferent_hashkey_objectvalue'
|
61
|
+
it_should_behave_like 'returndifferent_hashkey_stringvalue'
|
62
|
+
it_should_behave_like 'returndifferent_hashkey_hashvalue'
|
63
|
+
it_should_behave_like 'marshallable_key'
|
64
|
+
|
65
|
+
it 'should delete expired value in underlying file storage' do
|
66
|
+
@store.store('foo', 'bar', :expires => 2)
|
67
|
+
@store['foo'].should == 'bar'
|
68
|
+
sleep 1
|
69
|
+
@store['foo'].should == 'bar'
|
70
|
+
sleep 2
|
71
|
+
@store['foo'].should == nil
|
72
|
+
@store.adapter['foo'].should == nil
|
73
|
+
@store.adapter.adapter['foo'].should == nil
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
rescue LoadError => ex
|
78
|
+
puts "Test expires_file not executed: #{ex.message}"
|
79
|
+
rescue Exception => ex
|
80
|
+
puts "Test expires_file not executed: #{ex.message}"
|
81
|
+
#puts "#{ex.backtrace.join("\n")}"
|
82
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# Generated file
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
begin
|
5
|
+
|
6
|
+
Juno.build do
|
7
|
+
use :Expires
|
8
|
+
adapter :Memory
|
9
|
+
end.close
|
10
|
+
|
11
|
+
describe "expires_memory" do
|
12
|
+
before do
|
13
|
+
@store =
|
14
|
+
Juno.build do
|
15
|
+
use :Expires
|
16
|
+
adapter :Memory
|
17
|
+
end
|
18
|
+
@store.clear
|
19
|
+
end
|
20
|
+
|
21
|
+
after do
|
22
|
+
@store.close.should == nil if @store
|
23
|
+
end
|
24
|
+
|
25
|
+
it_should_behave_like 'null_objectkey_objectvalue'
|
26
|
+
it_should_behave_like 'null_objectkey_stringvalue'
|
27
|
+
it_should_behave_like 'null_objectkey_hashvalue'
|
28
|
+
it_should_behave_like 'null_stringkey_objectvalue'
|
29
|
+
it_should_behave_like 'null_stringkey_stringvalue'
|
30
|
+
it_should_behave_like 'null_stringkey_hashvalue'
|
31
|
+
it_should_behave_like 'null_hashkey_objectvalue'
|
32
|
+
it_should_behave_like 'null_hashkey_stringvalue'
|
33
|
+
it_should_behave_like 'null_hashkey_hashvalue'
|
34
|
+
it_should_behave_like 'store_objectkey_objectvalue'
|
35
|
+
it_should_behave_like 'store_objectkey_stringvalue'
|
36
|
+
it_should_behave_like 'store_objectkey_hashvalue'
|
37
|
+
it_should_behave_like 'store_stringkey_objectvalue'
|
38
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
39
|
+
it_should_behave_like 'store_stringkey_hashvalue'
|
40
|
+
it_should_behave_like 'store_hashkey_objectvalue'
|
41
|
+
it_should_behave_like 'store_hashkey_stringvalue'
|
42
|
+
it_should_behave_like 'store_hashkey_hashvalue'
|
43
|
+
it_should_behave_like 'expires_objectkey_objectvalue'
|
44
|
+
it_should_behave_like 'expires_objectkey_stringvalue'
|
45
|
+
it_should_behave_like 'expires_objectkey_hashvalue'
|
46
|
+
it_should_behave_like 'expires_stringkey_objectvalue'
|
47
|
+
it_should_behave_like 'expires_stringkey_stringvalue'
|
48
|
+
it_should_behave_like 'expires_stringkey_hashvalue'
|
49
|
+
it_should_behave_like 'expires_hashkey_objectvalue'
|
50
|
+
it_should_behave_like 'expires_hashkey_stringvalue'
|
51
|
+
it_should_behave_like 'expires_hashkey_hashvalue'
|
52
|
+
|
53
|
+
end
|
54
|
+
rescue LoadError => ex
|
55
|
+
puts "Test expires_memory not executed: #{ex.message}"
|
56
|
+
rescue Exception => ex
|
57
|
+
puts "Test expires_memory not executed: #{ex.message}"
|
58
|
+
#puts "#{ex.backtrace.join("\n")}"
|
59
|
+
end
|