moneta 0.7.10 → 0.7.11
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +2 -2
- data/CHANGES +8 -0
- data/Gemfile +7 -2
- data/README.md +7 -7
- data/Rakefile +35 -31
- data/lib/moneta/adapters/cassandra.rb +4 -0
- data/lib/moneta/adapters/couch.rb +36 -24
- data/lib/moneta/adapters/hbase.rb +5 -0
- data/lib/moneta/adapters/restclient.rb +11 -19
- data/lib/moneta/adapters/tokyotyrant.rb +27 -16
- data/lib/moneta/logger.rb +24 -7
- data/lib/moneta/transformer/config.rb +1 -0
- data/lib/moneta/version.rb +1 -1
- data/lib/rack/moneta_rest.rb +1 -1
- data/script/benchmarks +27 -27
- data/script/generate-specs +18 -9
- data/script/start-services +9 -1
- data/spec/moneta/adapter_activerecord_spec.rb +0 -4
- data/spec/moneta/adapter_cassandra_spec.rb +0 -4
- data/spec/moneta/adapter_cassandra_with_default_expires_spec.rb +0 -4
- data/spec/moneta/adapter_client_spec.rb +0 -4
- data/spec/moneta/adapter_cookie_spec.rb +0 -4
- data/spec/moneta/adapter_couch_spec.rb +0 -4
- data/spec/moneta/adapter_datamapper_spec.rb +0 -4
- data/spec/moneta/adapter_daybreak_spec.rb +0 -4
- data/spec/moneta/adapter_dbm_spec.rb +0 -4
- data/spec/moneta/adapter_file_spec.rb +0 -4
- data/spec/moneta/adapter_fog_spec.rb +0 -4
- data/spec/moneta/adapter_gdbm_spec.rb +0 -4
- data/spec/moneta/adapter_hbase_spec.rb +0 -4
- data/spec/moneta/adapter_kyotocabinet_spec.rb +0 -4
- data/spec/moneta/adapter_leveldb_spec.rb +0 -4
- data/spec/moneta/adapter_localmemcache_spec.rb +0 -4
- data/spec/moneta/adapter_lruhash_spec.rb +0 -4
- data/spec/moneta/adapter_memcached_dalli_spec.rb +0 -4
- data/spec/moneta/adapter_memcached_dalli_with_default_expires_spec.rb +0 -4
- data/spec/moneta/adapter_memcached_native_spec.rb +0 -4
- data/spec/moneta/adapter_memcached_native_with_default_expires_spec.rb +0 -4
- data/spec/moneta/adapter_memcached_spec.rb +0 -4
- data/spec/moneta/adapter_memcached_with_default_expires_spec.rb +0 -4
- data/spec/moneta/adapter_memory_spec.rb +0 -4
- data/spec/moneta/adapter_mongo_spec.rb +0 -4
- data/spec/moneta/adapter_mongo_with_default_expires_spec.rb +0 -4
- data/spec/moneta/adapter_pstore_spec.rb +0 -4
- data/spec/moneta/adapter_redis_spec.rb +0 -4
- data/spec/moneta/adapter_redis_with_default_expires_spec.rb +0 -4
- data/spec/moneta/adapter_restclient_spec.rb +0 -4
- data/spec/moneta/adapter_riak_spec.rb +0 -4
- data/spec/moneta/adapter_sdbm_spec.rb +0 -4
- data/spec/moneta/adapter_sequel_spec.rb +0 -4
- data/spec/moneta/adapter_sqlite_spec.rb +0 -4
- data/spec/moneta/adapter_tdb_spec.rb +0 -4
- data/spec/moneta/adapter_tokyocabinet_bdb_spec.rb +0 -4
- data/spec/moneta/adapter_tokyocabinet_hdb_spec.rb +0 -4
- data/spec/moneta/adapter_tokyotyrant_spec.rb +0 -4
- data/spec/moneta/adapter_yaml_spec.rb +0 -4
- data/spec/moneta/cache_file_memory_spec.rb +0 -4
- data/spec/moneta/cache_memory_null_spec.rb +0 -4
- data/spec/moneta/expires_file_spec.rb +0 -4
- data/spec/moneta/expires_memory_spec.rb +0 -4
- data/spec/moneta/expires_memory_with_default_expires_spec.rb +0 -4
- data/spec/moneta/lock_spec.rb +0 -4
- data/spec/moneta/mutex_spec.rb +1 -5
- data/spec/moneta/null_adapter_spec.rb +0 -4
- data/spec/moneta/optionmerger_spec.rb +1 -5
- data/spec/moneta/pool_spec.rb +0 -4
- data/spec/moneta/proxy_expires_memory_spec.rb +0 -4
- data/spec/moneta/proxy_redis_spec.rb +0 -4
- data/spec/moneta/semaphore_spec.rb +1 -5
- data/spec/moneta/shared_tcp_spec.rb +0 -4
- data/spec/moneta/shared_unix_spec.rb +0 -4
- data/spec/moneta/simple_activerecord_spec.rb +1 -5
- data/spec/moneta/simple_activerecord_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_cassandra_spec.rb +1 -5
- data/spec/moneta/simple_client_tcp_spec.rb +1 -5
- data/spec/moneta/simple_client_unix_spec.rb +1 -5
- data/spec/moneta/simple_couch_spec.rb +1 -5
- data/spec/moneta/simple_couch_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_datamapper_spec.rb +1 -5
- data/spec/moneta/simple_datamapper_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_datamapper_with_repository_spec.rb +1 -5
- data/spec/moneta/simple_daybreak_spec.rb +1 -5
- data/spec/moneta/simple_daybreak_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_dbm_spec.rb +1 -5
- data/spec/moneta/simple_dbm_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_file_spec.rb +1 -5
- data/spec/moneta/simple_file_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_fog_spec.rb +1 -5
- data/spec/moneta/simple_fog_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_gdbm_spec.rb +1 -5
- data/spec/moneta/simple_gdbm_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_hashfile_spec.rb +1 -5
- data/spec/moneta/simple_hashfile_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_hbase_spec.rb +1 -5
- data/spec/moneta/simple_hbase_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_kyotocabinet_spec.rb +1 -5
- data/spec/moneta/simple_kyotocabinet_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_leveldb_spec.rb +1 -5
- data/spec/moneta/simple_leveldb_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_localmemcache_spec.rb +1 -5
- data/spec/moneta/simple_localmemcache_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_lruhash_spec.rb +1 -5
- data/spec/moneta/simple_lruhash_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_memcached_dalli_spec.rb +1 -5
- data/spec/moneta/simple_memcached_native_spec.rb +1 -5
- data/spec/moneta/simple_memcached_spec.rb +1 -5
- data/spec/moneta/simple_memory_spec.rb +1 -5
- data/spec/moneta/simple_memory_with_compress_spec.rb +1 -5
- data/spec/moneta/simple_memory_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_memory_with_json_key_serializer_spec.rb +1 -5
- data/spec/moneta/simple_memory_with_json_serializer_spec.rb +1 -5
- data/spec/moneta/simple_memory_with_json_value_serializer_spec.rb +1 -5
- data/spec/moneta/simple_memory_with_prefix_spec.rb +1 -5
- data/spec/moneta/simple_memory_with_snappy_compress_spec.rb +1 -5
- data/spec/moneta/simple_mongo_spec.rb +1 -5
- data/spec/moneta/simple_null_spec.rb +1 -5
- data/spec/moneta/simple_pstore_spec.rb +1 -5
- data/spec/moneta/simple_pstore_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_redis_spec.rb +1 -5
- data/spec/moneta/simple_restclient_spec.rb +1 -5
- data/spec/moneta/simple_riak_spec.rb +1 -5
- data/spec/moneta/simple_riak_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_sdbm_spec.rb +1 -5
- data/spec/moneta/simple_sdbm_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_sequel_spec.rb +1 -5
- data/spec/moneta/simple_sequel_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_sqlite_spec.rb +1 -5
- data/spec/moneta/simple_sqlite_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_tdb_spec.rb +1 -5
- data/spec/moneta/simple_tdb_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_tokyocabinet_spec.rb +1 -5
- data/spec/moneta/simple_tokyocabinet_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_tokyotyrant_spec.rb +1 -5
- data/spec/moneta/simple_tokyotyrant_with_expires_spec.rb +1 -5
- data/spec/moneta/simple_yaml_spec.rb +1 -5
- data/spec/moneta/simple_yaml_with_expires_spec.rb +1 -5
- data/spec/moneta/stack_file_memory_spec.rb +0 -4
- data/spec/moneta/stack_memory_file_spec.rb +0 -4
- data/spec/moneta/transformer_bencode_spec.rb +0 -4
- data/spec/moneta/transformer_bert_spec.rb +0 -4
- data/spec/moneta/transformer_bson_spec.rb +0 -4
- data/spec/moneta/transformer_bzip2_spec.rb +0 -4
- data/spec/moneta/transformer_json_spec.rb +0 -4
- data/spec/moneta/transformer_key_inspect_spec.rb +0 -4
- data/spec/moneta/transformer_key_marshal_spec.rb +0 -4
- data/spec/moneta/transformer_key_to_s_spec.rb +0 -4
- data/spec/moneta/transformer_key_yaml_spec.rb +0 -4
- data/spec/moneta/transformer_lzma_spec.rb +0 -4
- data/spec/moneta/transformer_lzo_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_base64_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_escape_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_hmac_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_md5_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_md5_spread_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_prefix_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_qp_spec.rb +122 -0
- data/spec/moneta/transformer_marshal_rmd160_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_sha1_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_sha256_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_sha384_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_sha512_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_truncate_spec.rb +0 -4
- data/spec/moneta/transformer_marshal_uuencode_spec.rb +0 -4
- data/spec/moneta/transformer_msgpack_spec.rb +0 -4
- data/spec/moneta/transformer_ox_spec.rb +0 -4
- data/spec/moneta/transformer_quicklz_spec.rb +0 -4
- data/spec/moneta/transformer_snappy_spec.rb +0 -4
- data/spec/moneta/transformer_tnet_spec.rb +0 -4
- data/spec/moneta/transformer_value_marshal_spec.rb +0 -4
- data/spec/moneta/transformer_value_yaml_spec.rb +0 -4
- data/spec/moneta/transformer_yaml_spec.rb +0 -4
- data/spec/moneta/transformer_zlib_spec.rb +0 -4
- data/spec/moneta/weak_create_spec.rb +0 -4
- data/spec/moneta/weak_increment_spec.rb +0 -4
- data/spec/monetaspecs.rb +4 -4
- metadata +4 -2
data/script/generate-specs
CHANGED
@@ -973,6 +973,19 @@ end},
|
|
973
973
|
it 'compile transformer class' do
|
974
974
|
store.should_not be_nil
|
975
975
|
Moneta::Transformer::MarshalUuencodeKeyMarshalUuencodeValue.should_not be_nil
|
976
|
+
end}
|
977
|
+
},
|
978
|
+
'transformer_marshal_qp' => {
|
979
|
+
:build => %{Moneta.build do
|
980
|
+
use :Transformer, :key => [:marshal, :qp], :value => [:marshal, :qp]
|
981
|
+
adapter :Memory
|
982
|
+
end},
|
983
|
+
:specs => STANDARD_SPECS.without_persist,
|
984
|
+
:load_value => '::Marshal.load(value.unpack(\'M\').first)',
|
985
|
+
:tests => %{
|
986
|
+
it 'compile transformer class' do
|
987
|
+
store.should_not be_nil
|
988
|
+
Moneta::Transformer::MarshalQpKeyMarshalQpValue.should_not be_nil
|
976
989
|
end}
|
977
990
|
},
|
978
991
|
'transformer_marshal_escape' => {
|
@@ -1890,7 +1903,7 @@ it 'respects expires in delete', :retry => 3 do
|
|
1890
1903
|
store.delete('key2').should be_nil
|
1891
1904
|
end
|
1892
1905
|
|
1893
|
-
it 'supports the #expires syntactic sugar' do
|
1906
|
+
it 'supports the #expires syntactic sugar', :retry => 3 do
|
1894
1907
|
store.store('persistent_key', 'persistent_value', :expires => 0)
|
1895
1908
|
store.expires(1).store('key2', 'val2')
|
1896
1909
|
store['key2'].should == 'val2'
|
@@ -1906,7 +1919,7 @@ it 'supports false as no-expires on store and []' do
|
|
1906
1919
|
store['key1'].should == 'val1'
|
1907
1920
|
end
|
1908
1921
|
|
1909
|
-
it 'does not update the expiration time in key? when not asked to do so' do
|
1922
|
+
it 'does not update the expiration time in key? when not asked to do so', :retry => 3 do
|
1910
1923
|
store.store('key1', 'val1', :expires => 1)
|
1911
1924
|
store.key?('key1').should be_true
|
1912
1925
|
store.key?('key1', :expires => nil).should be_true
|
@@ -1914,7 +1927,7 @@ it 'does not update the expiration time in key? when not asked to do so' do
|
|
1914
1927
|
store.key?('key1').should be_false
|
1915
1928
|
end
|
1916
1929
|
|
1917
|
-
it 'does not update the expiration time in fetch when not asked to do so' do
|
1930
|
+
it 'does not update the expiration time in fetch when not asked to do so', :retry => 3 do
|
1918
1931
|
store.store('key1', 'val1', :expires => 1)
|
1919
1932
|
store.fetch('key1').should == 'val1'
|
1920
1933
|
store.fetch('key1', :expires => nil).should == 'val1'
|
@@ -1922,7 +1935,7 @@ it 'does not update the expiration time in fetch when not asked to do so' do
|
|
1922
1935
|
store.fetch('key1').should be_nil
|
1923
1936
|
end
|
1924
1937
|
|
1925
|
-
it 'does not update the expiration time in load when not asked to do so' do
|
1938
|
+
it 'does not update the expiration time in load when not asked to do so', :retry => 3 do
|
1926
1939
|
store.store('key1', 'val1', :expires => 1)
|
1927
1940
|
store.load('key1').should == 'val1'
|
1928
1941
|
store.load('key1', :expires => nil).should == 'val1'
|
@@ -2274,15 +2287,11 @@ TESTS.each do |name, options|
|
|
2274
2287
|
opts = options.delete(:options)
|
2275
2288
|
opts = ', ' << opts if opts
|
2276
2289
|
|
2277
|
-
build ||= "Moneta.new(#{store.inspect}#{opts}, :logger => {:
|
2290
|
+
build ||= "Moneta.new(#{store.inspect}#{opts}, :logger => {:file => File.join(make_tempdir, '#{name}.log')})"
|
2278
2291
|
|
2279
2292
|
code = %{#{header}require 'helper'
|
2280
2293
|
|
2281
2294
|
describe_moneta #{name.inspect} do
|
2282
|
-
def log
|
2283
|
-
@log ||= File.open(File.join(make_tempdir, '#{name}.log'), 'a')
|
2284
|
-
end
|
2285
|
-
|
2286
2295
|
def features
|
2287
2296
|
#{specs.features.to_a.inspect}
|
2288
2297
|
end
|
data/script/start-services
CHANGED
@@ -5,5 +5,13 @@ sudo service redis-server start
|
|
5
5
|
sudo service cassandra start
|
6
6
|
sudo service memcached start
|
7
7
|
sudo service mongodb start
|
8
|
-
|
8
|
+
|
9
|
+
echo 'Starting TokyoTyrant'
|
10
|
+
/usr/sbin/ttserver -dmn -pid /tmp/ttserver.pid -log /tmp/ttserver.log -port 1978
|
11
|
+
|
12
|
+
# Waiting for servers to start
|
9
13
|
sleep 3
|
14
|
+
|
15
|
+
echo 'TokyoTyrant status'
|
16
|
+
ps aux | grep ttserver
|
17
|
+
cat /tmp/ttserver.log
|
@@ -2,10 +2,6 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "adapter_memcached_dalli_with_default_expires" do
|
5
|
-
def log
|
6
|
-
@log ||= File.open(File.join(make_tempdir, 'adapter_memcached_dalli_with_default_expires.log'), 'a')
|
7
|
-
end
|
8
|
-
|
9
5
|
def features
|
10
6
|
[:create, :expires, :increment]
|
11
7
|
end
|
@@ -2,10 +2,6 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "adapter_memcached_native_with_default_expires" do
|
5
|
-
def log
|
6
|
-
@log ||= File.open(File.join(make_tempdir, 'adapter_memcached_native_with_default_expires.log'), 'a')
|
7
|
-
end
|
8
|
-
|
9
5
|
def features
|
10
6
|
[:create, :expires, :increment]
|
11
7
|
end
|
data/spec/moneta/lock_spec.rb
CHANGED
data/spec/moneta/mutex_spec.rb
CHANGED
@@ -2,16 +2,12 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "mutex" do
|
5
|
-
def log
|
6
|
-
@log ||= File.open(File.join(make_tempdir, 'mutex.log'), 'a')
|
7
|
-
end
|
8
|
-
|
9
5
|
def features
|
10
6
|
[]
|
11
7
|
end
|
12
8
|
|
13
9
|
def new_store
|
14
|
-
Moneta.new(:Memory, :logger => {:
|
10
|
+
Moneta.new(:Memory, :logger => {:file => File.join(make_tempdir, 'mutex.log')})
|
15
11
|
end
|
16
12
|
|
17
13
|
def load_value(value)
|