moneta 0.7.8 → 0.7.9
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -0
- data/CHANGES +6 -0
- data/Gemfile +1 -0
- data/README.md +107 -40
- data/SPEC.md +8 -0
- data/lib/moneta.rb +6 -7
- data/lib/moneta/adapters/activerecord.rb +2 -0
- data/lib/moneta/adapters/client.rb +9 -0
- data/lib/moneta/adapters/datamapper.rb +2 -0
- data/lib/moneta/adapters/file.rb +2 -0
- data/lib/moneta/adapters/kyotocabinet.rb +39 -0
- data/lib/moneta/adapters/lruhash.rb +1 -1
- data/lib/moneta/adapters/memcached/dalli.rb +3 -5
- data/lib/moneta/adapters/memcached/native.rb +2 -0
- data/lib/moneta/adapters/mongo.rb +2 -0
- data/lib/moneta/adapters/pstore.rb +2 -0
- data/lib/moneta/adapters/redis.rb +3 -3
- data/lib/moneta/adapters/sequel.rb +2 -0
- data/lib/moneta/adapters/sqlite.rb +2 -0
- data/lib/moneta/adapters/tokyocabinet.rb +2 -3
- data/lib/moneta/adapters/yaml.rb +1 -1
- data/lib/moneta/cache.rb +5 -0
- data/lib/moneta/expires.rb +1 -0
- data/lib/moneta/mixins.rb +68 -1
- data/lib/moneta/proxy.rb +5 -0
- data/lib/moneta/server.rb +1 -1
- data/lib/moneta/stack.rb +16 -0
- data/lib/moneta/synchronize.rb +3 -1
- data/lib/moneta/version.rb +1 -1
- data/lib/moneta/weak.rb +15 -1
- data/lib/moneta/wrapper.rb +5 -0
- data/script/benchmarks +2 -0
- data/script/generate-specs +64 -37
- data/script/install-bundle +2 -1
- data/script/install-kyotocabinet +17 -0
- data/spec/moneta/adapter_activerecord_spec.rb +5 -0
- data/spec/moneta/adapter_cassandra_spec.rb +5 -0
- data/spec/moneta/adapter_cassandra_with_default_expires_spec.rb +5 -0
- data/spec/moneta/adapter_client_spec.rb +5 -0
- data/spec/moneta/adapter_cookie_spec.rb +5 -0
- data/spec/moneta/adapter_couch_spec.rb +5 -0
- data/spec/moneta/adapter_datamapper_spec.rb +5 -0
- data/spec/moneta/adapter_daybreak_spec.rb +5 -0
- data/spec/moneta/adapter_dbm_spec.rb +5 -0
- data/spec/moneta/adapter_file_spec.rb +5 -0
- data/spec/moneta/adapter_fog_spec.rb +5 -0
- data/spec/moneta/adapter_gdbm_spec.rb +5 -0
- data/spec/moneta/adapter_hbase_spec.rb +5 -0
- data/spec/moneta/adapter_kyotocabinet_spec.rb +29 -0
- data/spec/moneta/adapter_leveldb_spec.rb +5 -0
- data/spec/moneta/adapter_localmemcache_spec.rb +5 -0
- data/spec/moneta/adapter_lruhash_spec.rb +5 -0
- data/spec/moneta/adapter_memcached_dalli_spec.rb +5 -0
- data/spec/moneta/adapter_memcached_dalli_with_default_expires_spec.rb +5 -0
- data/spec/moneta/adapter_memcached_native_spec.rb +5 -0
- data/spec/moneta/adapter_memcached_native_with_default_expires_spec.rb +5 -0
- data/spec/moneta/adapter_memcached_spec.rb +5 -0
- data/spec/moneta/adapter_memcached_with_default_expires_spec.rb +5 -0
- data/spec/moneta/adapter_memory_spec.rb +5 -0
- data/spec/moneta/adapter_mongo_spec.rb +5 -0
- data/spec/moneta/adapter_mongo_with_default_expires_spec.rb +5 -0
- data/spec/moneta/adapter_pstore_spec.rb +5 -0
- data/spec/moneta/adapter_redis_spec.rb +5 -0
- data/spec/moneta/adapter_redis_with_default_expires_spec.rb +5 -0
- data/spec/moneta/adapter_restclient_spec.rb +5 -0
- data/spec/moneta/adapter_riak_spec.rb +5 -0
- data/spec/moneta/adapter_sdbm_spec.rb +5 -0
- data/spec/moneta/adapter_sequel_spec.rb +5 -0
- data/spec/moneta/adapter_sqlite_spec.rb +5 -0
- data/spec/moneta/adapter_tdb_spec.rb +5 -0
- data/spec/moneta/adapter_tokyocabinet_bdb_spec.rb +5 -0
- data/spec/moneta/adapter_tokyocabinet_hdb_spec.rb +5 -0
- data/spec/moneta/adapter_yaml_spec.rb +5 -0
- data/spec/moneta/cache_file_memory_spec.rb +5 -0
- data/spec/moneta/cache_memory_null_spec.rb +5 -0
- data/spec/moneta/expires_file_spec.rb +5 -0
- data/spec/moneta/expires_memory_spec.rb +5 -0
- data/spec/moneta/expires_memory_with_default_expires_spec.rb +5 -0
- data/spec/moneta/lock_spec.rb +5 -0
- data/spec/moneta/mutex_spec.rb +4 -0
- data/spec/moneta/null_adapter_spec.rb +4 -0
- data/spec/moneta/optionmerger_spec.rb +8 -0
- data/spec/moneta/pool_spec.rb +5 -0
- data/spec/moneta/proxy_expires_memory_spec.rb +5 -0
- data/spec/moneta/proxy_redis_spec.rb +5 -0
- data/spec/moneta/semaphore_spec.rb +4 -0
- data/spec/moneta/shared_tcp_spec.rb +5 -0
- data/spec/moneta/shared_unix_spec.rb +5 -0
- data/spec/moneta/simple_activerecord_spec.rb +5 -0
- data/spec/moneta/simple_activerecord_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_cassandra_spec.rb +5 -0
- data/spec/moneta/simple_client_tcp_spec.rb +5 -0
- data/spec/moneta/simple_client_unix_spec.rb +5 -0
- data/spec/moneta/simple_couch_spec.rb +5 -0
- data/spec/moneta/simple_couch_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_datamapper_spec.rb +5 -0
- data/spec/moneta/simple_datamapper_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_datamapper_with_repository_spec.rb +5 -0
- data/spec/moneta/simple_daybreak_spec.rb +5 -0
- data/spec/moneta/simple_daybreak_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_dbm_spec.rb +5 -0
- data/spec/moneta/simple_dbm_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_file_spec.rb +5 -0
- data/spec/moneta/simple_file_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_fog_spec.rb +5 -0
- data/spec/moneta/simple_fog_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_gdbm_spec.rb +5 -0
- data/spec/moneta/simple_gdbm_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_hashfile_spec.rb +5 -0
- data/spec/moneta/simple_hashfile_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_hbase_spec.rb +5 -0
- data/spec/moneta/simple_hbase_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_kyotocabinet_spec.rb +154 -0
- data/spec/moneta/simple_kyotocabinet_with_expires_spec.rb +156 -0
- data/spec/moneta/simple_leveldb_spec.rb +5 -0
- data/spec/moneta/simple_leveldb_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_localmemcache_spec.rb +5 -0
- data/spec/moneta/simple_localmemcache_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_lruhash_spec.rb +5 -0
- data/spec/moneta/simple_lruhash_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_memcached_dalli_spec.rb +5 -0
- data/spec/moneta/simple_memcached_native_spec.rb +5 -0
- data/spec/moneta/simple_memcached_spec.rb +5 -0
- data/spec/moneta/simple_memory_spec.rb +5 -0
- data/spec/moneta/simple_memory_with_compress_spec.rb +5 -0
- data/spec/moneta/simple_memory_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_memory_with_json_key_serializer_spec.rb +5 -0
- data/spec/moneta/simple_memory_with_json_serializer_spec.rb +5 -0
- data/spec/moneta/simple_memory_with_json_value_serializer_spec.rb +5 -0
- data/spec/moneta/simple_memory_with_prefix_spec.rb +5 -0
- data/spec/moneta/simple_memory_with_snappy_compress_spec.rb +5 -0
- data/spec/moneta/simple_mongo_spec.rb +5 -0
- data/spec/moneta/simple_null_spec.rb +5 -0
- data/spec/moneta/simple_pstore_spec.rb +5 -0
- data/spec/moneta/simple_pstore_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_redis_spec.rb +5 -0
- data/spec/moneta/simple_restclient_spec.rb +5 -0
- data/spec/moneta/simple_riak_spec.rb +5 -0
- data/spec/moneta/simple_riak_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_sdbm_spec.rb +5 -0
- data/spec/moneta/simple_sdbm_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_sequel_spec.rb +5 -0
- data/spec/moneta/simple_sequel_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_sqlite_spec.rb +5 -0
- data/spec/moneta/simple_sqlite_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_tdb_spec.rb +5 -0
- data/spec/moneta/simple_tdb_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_tokyocabinet_spec.rb +5 -0
- data/spec/moneta/simple_tokyocabinet_with_expires_spec.rb +5 -0
- data/spec/moneta/simple_yaml_spec.rb +5 -0
- data/spec/moneta/simple_yaml_with_expires_spec.rb +5 -0
- data/spec/moneta/stack_file_memory_spec.rb +5 -0
- data/spec/moneta/stack_memory_file_spec.rb +7 -4
- data/spec/moneta/transformer_bencode_spec.rb +5 -0
- data/spec/moneta/transformer_bert_spec.rb +5 -0
- data/spec/moneta/transformer_bson_spec.rb +5 -0
- data/spec/moneta/transformer_bzip2_spec.rb +5 -0
- data/spec/moneta/transformer_json_spec.rb +5 -0
- data/spec/moneta/transformer_key_inspect_spec.rb +5 -0
- data/spec/moneta/transformer_key_marshal_spec.rb +5 -0
- data/spec/moneta/transformer_key_to_s_spec.rb +5 -0
- data/spec/moneta/transformer_key_yaml_spec.rb +5 -0
- data/spec/moneta/transformer_lzma_spec.rb +5 -0
- data/spec/moneta/transformer_lzo_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_base64_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_escape_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_hmac_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_md5_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_md5_spread_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_prefix_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_rmd160_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_sha1_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_sha256_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_sha384_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_sha512_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_truncate_spec.rb +5 -0
- data/spec/moneta/transformer_marshal_uuencode_spec.rb +5 -0
- data/spec/moneta/transformer_msgpack_spec.rb +5 -0
- data/spec/moneta/transformer_ox_spec.rb +5 -0
- data/spec/moneta/transformer_quicklz_spec.rb +5 -0
- data/spec/moneta/transformer_snappy_spec.rb +5 -0
- data/spec/moneta/transformer_tnet_spec.rb +5 -0
- data/spec/moneta/transformer_value_marshal_spec.rb +5 -0
- data/spec/moneta/transformer_value_yaml_spec.rb +5 -0
- data/spec/moneta/transformer_yaml_spec.rb +5 -0
- data/spec/moneta/transformer_zlib_spec.rb +5 -0
- data/spec/moneta/weak_create_spec.rb +10 -91
- data/spec/moneta/weak_increment_spec.rb +10 -91
- data/spec/monetaspecs.rb +19 -0
- metadata +10 -2
data/script/install-bundle
CHANGED
@@ -22,5 +22,6 @@ if system("wget --no-check-certificate --quiet -O #{BUNDLE_FILE} https://moneta:
|
|
22
22
|
cmd "rm -f #{BUNDLE_FILE}"
|
23
23
|
else
|
24
24
|
cmd 'bundle install --path .bundle'
|
25
|
-
cmd
|
25
|
+
cmd 'bundle install --deployment --path .bundle'
|
26
|
+
cmd "tar -cpzf #{BUNDLE_FILE} Gemfile.lock .bundle"
|
26
27
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
if `wget --no-check-certificate --quiet -O kyotocabinet.tar.gz https://moneta:$DAV_PW@mendler.net/dav/kyotocabinet.tar.gz`; then
|
4
|
+
tar -xf kyotocabinet.tar.gz
|
5
|
+
else
|
6
|
+
wget http://fallabs.com/kyotocabinet/pkg/kyotocabinet-1.2.76.tar.gz
|
7
|
+
tar -xzf kyotocabinet-*.tar.gz
|
8
|
+
rm kyotocabinet-*.tar.gz
|
9
|
+
cd kyotocabinet-*
|
10
|
+
./configure --prefix=/usr
|
11
|
+
make
|
12
|
+
cd ..
|
13
|
+
tar -czf kyotocabinet.tar.gz kyotocabinet-*
|
14
|
+
curl -u moneta:$DAV_PW -k -T kyotocabinet.tar.gz https://mendler.net/dav/ || echo 'Nothing uploaded'
|
15
|
+
fi
|
16
|
+
cd kyotocabinet-*
|
17
|
+
sudo make install
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_activerecord" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_activerecord.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::ActiveRecord.new(:connection => { :adapter => (defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3'), :database => File.join(make_tempdir, 'adapter_activerecord') })
|
11
15
|
end
|
@@ -16,6 +20,7 @@ describe_moneta "adapter_activerecord" do
|
|
16
20
|
|
17
21
|
include_context 'setup_store'
|
18
22
|
it_should_behave_like 'create'
|
23
|
+
it_should_behave_like 'features'
|
19
24
|
it_should_behave_like 'increment'
|
20
25
|
it_should_behave_like 'multiprocess'
|
21
26
|
it_should_behave_like 'null_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_cassandra" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_cassandra.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:expires]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::Cassandra.new(:keyspace => 'adapter_cassandra')
|
11
15
|
end
|
@@ -16,6 +20,7 @@ describe_moneta "adapter_cassandra" do
|
|
16
20
|
|
17
21
|
include_context 'setup_store'
|
18
22
|
it_should_behave_like 'expires'
|
23
|
+
it_should_behave_like 'features'
|
19
24
|
it_should_behave_like 'multiprocess'
|
20
25
|
it_should_behave_like 'not_create'
|
21
26
|
it_should_behave_like 'not_increment'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_cassandra_with_default_expires" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_cassandra_with_default_expires.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:expires]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::Cassandra.new(:keyspace => 'adapter_cassandra_with_default_expires', :expires => 1)
|
11
15
|
end
|
@@ -17,6 +21,7 @@ describe_moneta "adapter_cassandra_with_default_expires" do
|
|
17
21
|
include_context 'setup_store'
|
18
22
|
it_should_behave_like 'default_expires'
|
19
23
|
it_should_behave_like 'expires'
|
24
|
+
it_should_behave_like 'features'
|
20
25
|
it_should_behave_like 'multiprocess'
|
21
26
|
it_should_behave_like 'not_create'
|
22
27
|
it_should_behave_like 'not_increment'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_client" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_client.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
start_server(Moneta::Adapters::Memory.new)
|
10
14
|
def new_store
|
11
15
|
Moneta::Adapters::Client.new
|
@@ -17,6 +21,7 @@ describe_moneta "adapter_client" do
|
|
17
21
|
|
18
22
|
include_context 'setup_store'
|
19
23
|
it_should_behave_like 'create'
|
24
|
+
it_should_behave_like 'features'
|
20
25
|
it_should_behave_like 'increment'
|
21
26
|
it_should_behave_like 'multiprocess'
|
22
27
|
it_should_behave_like 'null_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_cookie" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_cookie.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::Cookie.new
|
11
15
|
end
|
@@ -16,6 +20,7 @@ describe_moneta "adapter_cookie" do
|
|
16
20
|
|
17
21
|
include_context 'setup_store'
|
18
22
|
it_should_behave_like 'create'
|
23
|
+
it_should_behave_like 'features'
|
19
24
|
it_should_behave_like 'increment'
|
20
25
|
it_should_behave_like 'not_persist'
|
21
26
|
it_should_behave_like 'null_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_couch" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_couch.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::Couch.new(:db => 'adapter_couch')
|
11
15
|
end
|
@@ -15,6 +19,7 @@ describe_moneta "adapter_couch" do
|
|
15
19
|
end
|
16
20
|
|
17
21
|
include_context 'setup_store'
|
22
|
+
it_should_behave_like 'features'
|
18
23
|
it_should_behave_like 'multiprocess'
|
19
24
|
it_should_behave_like 'not_create'
|
20
25
|
it_should_behave_like 'not_increment'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_datamapper" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_datamapper.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create]
|
11
|
+
end
|
12
|
+
|
9
13
|
require 'dm-core'
|
10
14
|
DataMapper.setup(:default, :adapter => :in_memory)
|
11
15
|
def new_store
|
@@ -18,6 +22,7 @@ describe_moneta "adapter_datamapper" do
|
|
18
22
|
|
19
23
|
include_context 'setup_store'
|
20
24
|
it_should_behave_like 'create'
|
25
|
+
it_should_behave_like 'features'
|
21
26
|
it_should_behave_like 'multiprocess'
|
22
27
|
it_should_behave_like 'not_increment'
|
23
28
|
it_should_behave_like 'null_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_daybreak" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_daybreak.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::Daybreak.new(:file => File.join(make_tempdir, "adapter_daybreak"))
|
11
15
|
end
|
@@ -16,6 +20,7 @@ describe_moneta "adapter_daybreak" do
|
|
16
20
|
|
17
21
|
include_context 'setup_store'
|
18
22
|
it_should_behave_like 'create'
|
23
|
+
it_should_behave_like 'features'
|
19
24
|
it_should_behave_like 'increment'
|
20
25
|
it_should_behave_like 'null_stringkey_stringvalue'
|
21
26
|
it_should_behave_like 'persist_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_dbm" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_dbm.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::DBM.new(:file => File.join(make_tempdir, "adapter_dbm"))
|
11
15
|
end
|
@@ -16,6 +20,7 @@ describe_moneta "adapter_dbm" do
|
|
16
20
|
|
17
21
|
include_context 'setup_store'
|
18
22
|
it_should_behave_like 'create'
|
23
|
+
it_should_behave_like 'features'
|
19
24
|
it_should_behave_like 'increment'
|
20
25
|
it_should_behave_like 'null_stringkey_stringvalue'
|
21
26
|
it_should_behave_like 'persist_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_file" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_file.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::File.new(:dir => File.join(make_tempdir, "adapter_file"))
|
11
15
|
end
|
@@ -16,6 +20,7 @@ describe_moneta "adapter_file" do
|
|
16
20
|
|
17
21
|
include_context 'setup_store'
|
18
22
|
it_should_behave_like 'create'
|
23
|
+
it_should_behave_like 'features'
|
19
24
|
it_should_behave_like 'increment'
|
20
25
|
it_should_behave_like 'multiprocess'
|
21
26
|
it_should_behave_like 'null_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_fog" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_fog.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[]
|
11
|
+
end
|
12
|
+
|
9
13
|
require 'fog'
|
10
14
|
Fog.mock!
|
11
15
|
def new_store
|
@@ -20,6 +24,7 @@ describe_moneta "adapter_fog" do
|
|
20
24
|
end
|
21
25
|
|
22
26
|
include_context 'setup_store'
|
27
|
+
it_should_behave_like 'features'
|
23
28
|
it_should_behave_like 'multiprocess'
|
24
29
|
it_should_behave_like 'not_create'
|
25
30
|
it_should_behave_like 'not_increment'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_gdbm" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_gdbm.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::GDBM.new(:file => File.join(make_tempdir, "adapter_gdbm"))
|
11
15
|
end
|
@@ -16,6 +20,7 @@ describe_moneta "adapter_gdbm" do
|
|
16
20
|
|
17
21
|
include_context 'setup_store'
|
18
22
|
it_should_behave_like 'create'
|
23
|
+
it_should_behave_like 'features'
|
19
24
|
it_should_behave_like 'increment'
|
20
25
|
it_should_behave_like 'null_stringkey_stringvalue'
|
21
26
|
it_should_behave_like 'persist_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_hbase" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_hbase.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::HBase.new(:table => 'adapter_hbase')
|
11
15
|
end
|
@@ -15,6 +19,7 @@ describe_moneta "adapter_hbase" do
|
|
15
19
|
end
|
16
20
|
|
17
21
|
include_context 'setup_store'
|
22
|
+
it_should_behave_like 'features'
|
18
23
|
it_should_behave_like 'increment'
|
19
24
|
it_should_behave_like 'multiprocess'
|
20
25
|
it_should_behave_like 'not_create'
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Generated by generate-specs
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
describe_moneta "adapter_kyotocabinet" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'adapter_kyotocabinet.log'), 'a')
|
7
|
+
end
|
8
|
+
|
9
|
+
def features
|
10
|
+
[:create, :increment]
|
11
|
+
end
|
12
|
+
|
13
|
+
def new_store
|
14
|
+
Moneta::Adapters::KyotoCabinet.new(:file => File.join(make_tempdir, "adapter_kyotocabinet.kch"))
|
15
|
+
end
|
16
|
+
|
17
|
+
def load_value(value)
|
18
|
+
Marshal.load(value)
|
19
|
+
end
|
20
|
+
|
21
|
+
include_context 'setup_store'
|
22
|
+
it_should_behave_like 'create'
|
23
|
+
it_should_behave_like 'features'
|
24
|
+
it_should_behave_like 'increment'
|
25
|
+
it_should_behave_like 'null_stringkey_stringvalue'
|
26
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
27
|
+
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
28
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
29
|
+
end
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_leveldb" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_leveldb.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::LevelDB.new(:dir => File.join(make_tempdir, "adapter_leveldb"))
|
11
15
|
end
|
@@ -16,6 +20,7 @@ describe_moneta "adapter_leveldb" do
|
|
16
20
|
|
17
21
|
include_context 'setup_store'
|
18
22
|
it_should_behave_like 'create'
|
23
|
+
it_should_behave_like 'features'
|
19
24
|
it_should_behave_like 'increment'
|
20
25
|
it_should_behave_like 'null_stringkey_stringvalue'
|
21
26
|
it_should_behave_like 'persist_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_localmemcache" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_localmemcache.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::LocalMemCache.new(:file => File.join(make_tempdir, "adapter_localmemcache"))
|
11
15
|
end
|
@@ -15,6 +19,7 @@ describe_moneta "adapter_localmemcache" do
|
|
15
19
|
end
|
16
20
|
|
17
21
|
include_context 'setup_store'
|
22
|
+
it_should_behave_like 'features'
|
18
23
|
it_should_behave_like 'multiprocess'
|
19
24
|
it_should_behave_like 'not_create'
|
20
25
|
it_should_behave_like 'not_increment'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_lruhash" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_lruhash.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::LRUHash.new
|
11
15
|
end
|
@@ -16,6 +20,7 @@ describe_moneta "adapter_lruhash" do
|
|
16
20
|
|
17
21
|
include_context 'setup_store'
|
18
22
|
it_should_behave_like 'create'
|
23
|
+
it_should_behave_like 'features'
|
19
24
|
it_should_behave_like 'increment'
|
20
25
|
it_should_behave_like 'not_persist'
|
21
26
|
it_should_behave_like 'null_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_memcached_dalli" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_memcached_dalli.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :expires, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::MemcachedDalli.new(:namespace => "adapter_memcached_dalli")
|
11
15
|
end
|
@@ -18,6 +22,7 @@ describe_moneta "adapter_memcached_dalli" do
|
|
18
22
|
it_should_behave_like 'create'
|
19
23
|
it_should_behave_like 'create_expires'
|
20
24
|
it_should_behave_like 'expires'
|
25
|
+
it_should_behave_like 'features'
|
21
26
|
it_should_behave_like 'increment'
|
22
27
|
it_should_behave_like 'multiprocess'
|
23
28
|
it_should_behave_like 'null_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_memcached_dalli_with_default_expires" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_memcached_dalli_with_default_expires.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :expires, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::MemcachedDalli.new(:expires => 1)
|
11
15
|
end
|
@@ -19,6 +23,7 @@ describe_moneta "adapter_memcached_dalli_with_default_expires" do
|
|
19
23
|
it_should_behave_like 'create_expires'
|
20
24
|
it_should_behave_like 'default_expires'
|
21
25
|
it_should_behave_like 'expires'
|
26
|
+
it_should_behave_like 'features'
|
22
27
|
it_should_behave_like 'increment'
|
23
28
|
it_should_behave_like 'multiprocess'
|
24
29
|
it_should_behave_like 'null_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_memcached_native" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_memcached_native.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :expires, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::MemcachedNative.new(:namespace => "adapter_memcached_native")
|
11
15
|
end
|
@@ -18,6 +22,7 @@ describe_moneta "adapter_memcached_native" do
|
|
18
22
|
it_should_behave_like 'create'
|
19
23
|
it_should_behave_like 'create_expires'
|
20
24
|
it_should_behave_like 'expires'
|
25
|
+
it_should_behave_like 'features'
|
21
26
|
it_should_behave_like 'increment'
|
22
27
|
it_should_behave_like 'multiprocess'
|
23
28
|
it_should_behave_like 'null_stringkey_stringvalue'
|
@@ -6,6 +6,10 @@ describe_moneta "adapter_memcached_native_with_default_expires" do
|
|
6
6
|
@log ||= File.open(File.join(make_tempdir, 'adapter_memcached_native_with_default_expires.log'), 'a')
|
7
7
|
end
|
8
8
|
|
9
|
+
def features
|
10
|
+
[:create, :expires, :increment]
|
11
|
+
end
|
12
|
+
|
9
13
|
def new_store
|
10
14
|
Moneta::Adapters::MemcachedNative.new(:expires => 1)
|
11
15
|
end
|
@@ -19,6 +23,7 @@ describe_moneta "adapter_memcached_native_with_default_expires" do
|
|
19
23
|
it_should_behave_like 'create_expires'
|
20
24
|
it_should_behave_like 'default_expires'
|
21
25
|
it_should_behave_like 'expires'
|
26
|
+
it_should_behave_like 'features'
|
22
27
|
it_should_behave_like 'increment'
|
23
28
|
it_should_behave_like 'multiprocess'
|
24
29
|
it_should_behave_like 'null_stringkey_stringvalue'
|