moneta 0.7.20 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -5
- data/CHANGES +6 -0
- data/CONTRIBUTORS +2 -0
- data/Gemfile +31 -44
- data/LICENSE +1 -1
- data/README.md +82 -59
- data/lib/active_support/cache/moneta_store.rb +3 -3
- data/lib/moneta.rb +4 -2
- data/lib/moneta/adapters/activerecord.rb +8 -8
- data/lib/moneta/adapters/cassandra.rb +8 -8
- data/lib/moneta/adapters/couch.rb +1 -1
- data/lib/moneta/adapters/datamapper.rb +5 -5
- data/lib/moneta/adapters/daybreak.rb +1 -1
- data/lib/moneta/adapters/fog.rb +2 -2
- data/lib/moneta/adapters/lmdb.rb +1 -1
- data/lib/moneta/adapters/localmemcache.rb +1 -1
- data/lib/moneta/adapters/memcached/dalli.rb +3 -3
- data/lib/moneta/adapters/memcached/native.rb +1 -1
- data/lib/moneta/adapters/mongo.rb +6 -164
- data/lib/moneta/adapters/mongo/base.rb +63 -0
- data/lib/moneta/adapters/mongo/moped.rb +113 -0
- data/lib/moneta/adapters/mongo/official.rb +121 -0
- data/lib/moneta/adapters/pstore.rb +1 -5
- data/lib/moneta/adapters/restclient.rb +1 -1
- data/lib/moneta/adapters/sequel.rb +10 -10
- data/lib/moneta/cache.rb +1 -1
- data/lib/moneta/logger.rb +2 -2
- data/lib/moneta/mixins.rb +4 -4
- data/lib/moneta/shared.rb +2 -2
- data/lib/moneta/stack.rb +2 -2
- data/lib/moneta/synchronize.rb +2 -2
- data/lib/moneta/transformer.rb +5 -5
- data/lib/moneta/transformer/config.rb +38 -40
- data/lib/moneta/version.rb +1 -1
- data/lib/rack/cache/moneta.rb +1 -1
- data/lib/rack/moneta_cookies.rb +2 -2
- data/lib/rack/moneta_rest.rb +1 -1
- data/lib/rack/moneta_store.rb +4 -4
- data/lib/rack/session/moneta.rb +14 -2
- data/moneta.gemspec +1 -0
- data/script/benchmarks +97 -96
- data/script/generate-specs +763 -730
- data/script/install-bundle +1 -1
- data/script/install-kyotocabinet +2 -2
- data/script/memusage +1 -1
- data/script/upload-bundle +1 -1
- data/spec/action_dispatch/session_moneta_store_spec.rb +5 -5
- data/spec/active_support/cache_moneta_store_spec.rb +20 -20
- data/spec/moneta/adapter_activerecord_exisiting_connection_spec.rb +2 -2
- data/spec/moneta/adapter_activerecord_spec.rb +6 -6
- data/spec/moneta/adapter_cassandra_spec.rb +1 -1
- data/spec/moneta/adapter_cassandra_with_default_expires_spec.rb +1 -1
- data/spec/moneta/adapter_couch_spec.rb +1 -1
- data/spec/moneta/adapter_datamapper_spec.rb +6 -6
- data/spec/moneta/adapter_daybreak_spec.rb +1 -1
- data/spec/moneta/adapter_dbm_spec.rb +1 -1
- data/spec/moneta/adapter_file_spec.rb +1 -1
- data/spec/moneta/adapter_fog_spec.rb +4 -4
- data/spec/moneta/adapter_gdbm_spec.rb +1 -1
- data/spec/moneta/adapter_hbase_spec.rb +1 -1
- data/spec/moneta/adapter_kyotocabinet_spec.rb +1 -1
- data/spec/moneta/adapter_leveldb_spec.rb +1 -1
- data/spec/moneta/adapter_lmdb_spec.rb +1 -1
- data/spec/moneta/adapter_lmdb_with_db_spec.rb +1 -1
- data/spec/moneta/adapter_localmemcache_spec.rb +1 -1
- data/spec/moneta/adapter_lruhash_spec.rb +1 -1
- data/spec/moneta/adapter_memcached_dalli_spec.rb +1 -1
- data/spec/moneta/adapter_memcached_dalli_with_default_expires_spec.rb +1 -1
- data/spec/moneta/adapter_memcached_native_spec.rb +1 -1
- data/spec/moneta/adapter_memcached_native_with_default_expires_spec.rb +1 -1
- data/spec/moneta/adapter_memcached_spec.rb +1 -1
- data/spec/moneta/adapter_memcached_with_default_expires_spec.rb +1 -1
- data/spec/moneta/adapter_mongo_moped_spec.rb +56 -0
- data/spec/moneta/adapter_mongo_moped_with_default_expires_spec.rb +51 -0
- data/spec/moneta/adapter_mongo_official_spec.rb +56 -0
- data/spec/moneta/adapter_mongo_official_with_default_expires_spec.rb +51 -0
- data/spec/moneta/adapter_mongo_spec.rb +1 -7
- data/spec/moneta/adapter_mongo_with_default_expires_spec.rb +1 -1
- data/spec/moneta/adapter_pstore_spec.rb +1 -1
- data/spec/moneta/adapter_redis_with_default_expires_spec.rb +1 -1
- data/spec/moneta/adapter_restclient_spec.rb +1 -1
- data/spec/moneta/adapter_sdbm_spec.rb +1 -1
- data/spec/moneta/adapter_sequel_spec.rb +1 -1
- data/spec/moneta/adapter_sqlite_spec.rb +1 -1
- data/spec/moneta/adapter_tdb_spec.rb +1 -1
- data/spec/moneta/adapter_tokyocabinet_bdb_spec.rb +1 -1
- data/spec/moneta/adapter_tokyocabinet_hdb_spec.rb +1 -1
- data/spec/moneta/adapter_yaml_spec.rb +1 -1
- data/spec/moneta/cache_file_memory_spec.rb +1 -1
- data/spec/moneta/expires_file_spec.rb +3 -3
- data/spec/moneta/expires_memory_with_default_expires_spec.rb +1 -1
- data/spec/moneta/mutex_spec.rb +1 -1
- data/spec/moneta/optionmerger_spec.rb +26 -26
- data/spec/moneta/pool_spec.rb +1 -1
- data/spec/moneta/semaphore_spec.rb +1 -1
- data/spec/moneta/shared_tcp_spec.rb +2 -2
- data/spec/moneta/shared_unix_spec.rb +2 -2
- data/spec/moneta/stack_file_memory_spec.rb +1 -1
- data/spec/moneta/stack_memory_file_spec.rb +1 -1
- data/spec/moneta/standard_activerecord_spec.rb +1 -1
- data/spec/moneta/standard_activerecord_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_cassandra_spec.rb +1 -1
- data/spec/moneta/standard_client_tcp_spec.rb +1 -1
- data/spec/moneta/standard_client_unix_spec.rb +2 -2
- data/spec/moneta/standard_couch_spec.rb +1 -1
- data/spec/moneta/standard_couch_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_datamapper_spec.rb +2 -2
- data/spec/moneta/standard_datamapper_with_expires_spec.rb +2 -2
- data/spec/moneta/standard_datamapper_with_repository_spec.rb +2 -2
- data/spec/moneta/standard_daybreak_spec.rb +1 -1
- data/spec/moneta/standard_daybreak_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_dbm_spec.rb +1 -1
- data/spec/moneta/standard_dbm_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_file_spec.rb +1 -1
- data/spec/moneta/standard_file_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_fog_spec.rb +4 -4
- data/spec/moneta/standard_fog_with_expires_spec.rb +5 -5
- data/spec/moneta/standard_gdbm_spec.rb +1 -1
- data/spec/moneta/standard_gdbm_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_hashfile_spec.rb +1 -1
- data/spec/moneta/standard_hashfile_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_hbase_spec.rb +1 -1
- data/spec/moneta/standard_hbase_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_kyotocabinet_spec.rb +1 -1
- data/spec/moneta/standard_kyotocabinet_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_leveldb_spec.rb +1 -1
- data/spec/moneta/standard_leveldb_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_lmdb_spec.rb +1 -1
- data/spec/moneta/standard_lmdb_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_localmemcache_spec.rb +1 -1
- data/spec/moneta/standard_localmemcache_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_lruhash_spec.rb +1 -1
- data/spec/moneta/standard_lruhash_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_memcached_dalli_spec.rb +1 -1
- data/spec/moneta/standard_memcached_native_spec.rb +1 -1
- data/spec/moneta/standard_memcached_spec.rb +1 -1
- data/spec/moneta/standard_memory_spec.rb +1 -1
- data/spec/moneta/standard_memory_with_compress_spec.rb +1 -1
- data/spec/moneta/standard_memory_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_memory_with_json_key_serializer_spec.rb +1 -1
- data/spec/moneta/standard_memory_with_json_serializer_spec.rb +1 -1
- data/spec/moneta/standard_memory_with_json_value_serializer_spec.rb +1 -1
- data/spec/moneta/standard_memory_with_prefix_spec.rb +1 -1
- data/spec/moneta/standard_memory_with_snappy_compress_spec.rb +1 -1
- data/spec/moneta/standard_mongo_moped_spec.rb +255 -0
- data/spec/moneta/standard_mongo_official_spec.rb +255 -0
- data/spec/moneta/standard_mongo_spec.rb +1 -1
- data/spec/moneta/standard_null_spec.rb +1 -1
- data/spec/moneta/standard_pstore_spec.rb +1 -1
- data/spec/moneta/standard_pstore_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_redis_spec.rb +1 -1
- data/spec/moneta/standard_restclient_spec.rb +1 -1
- data/spec/moneta/standard_riak_spec.rb +1 -1
- data/spec/moneta/standard_riak_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_sdbm_spec.rb +1 -1
- data/spec/moneta/standard_sdbm_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_sequel_spec.rb +1 -1
- data/spec/moneta/standard_sequel_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_sqlite_spec.rb +1 -1
- data/spec/moneta/standard_sqlite_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_tdb_spec.rb +1 -1
- data/spec/moneta/standard_tdb_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_tokyocabinet_spec.rb +1 -1
- data/spec/moneta/standard_tokyocabinet_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_tokyotyrant_spec.rb +1 -1
- data/spec/moneta/standard_tokyotyrant_with_expires_spec.rb +1 -1
- data/spec/moneta/standard_yaml_spec.rb +1 -1
- data/spec/moneta/standard_yaml_with_expires_spec.rb +1 -1
- data/spec/moneta/transformer_bencode_spec.rb +1 -1
- data/spec/moneta/transformer_bert_spec.rb +1 -1
- data/spec/moneta/transformer_bson_spec.rb +1 -1
- data/spec/moneta/transformer_bzip2_spec.rb +1 -1
- data/spec/moneta/transformer_json_spec.rb +1 -1
- data/spec/moneta/transformer_key_inspect_spec.rb +1 -1
- data/spec/moneta/transformer_key_marshal_spec.rb +1 -1
- data/spec/moneta/transformer_key_to_s_spec.rb +1 -1
- data/spec/moneta/transformer_key_yaml_spec.rb +1 -1
- data/spec/moneta/transformer_lz4_spec.rb +1 -1
- data/spec/moneta/transformer_lzma_spec.rb +1 -1
- data/spec/moneta/transformer_lzo_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_base64_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_city128_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_city32_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_city64_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_escape_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_hex_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_hmac_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_md5_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_md5_spread_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_prefix_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_qp_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_rmd160_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_sha1_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_sha256_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_sha384_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_sha512_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_truncate_spec.rb +1 -1
- data/spec/moneta/transformer_marshal_uuencode_spec.rb +1 -1
- data/spec/moneta/transformer_msgpack_spec.rb +1 -1
- data/spec/moneta/transformer_ox_spec.rb +1 -1
- data/spec/moneta/transformer_php_spec.rb +1 -1
- data/spec/moneta/transformer_quicklz_spec.rb +1 -1
- data/spec/moneta/transformer_snappy_spec.rb +1 -1
- data/spec/moneta/transformer_tnet_spec.rb +1 -1
- data/spec/moneta/transformer_value_marshal_spec.rb +1 -1
- data/spec/moneta/transformer_value_yaml_spec.rb +1 -1
- data/spec/moneta/transformer_yaml_spec.rb +1 -1
- data/spec/moneta/transformer_zlib_spec.rb +1 -1
- data/spec/moneta/weak_create_spec.rb +4 -4
- data/spec/moneta/weak_increment_spec.rb +4 -4
- data/spec/monetaspecs.rb +481 -481
- metadata +14 -185
data/spec/moneta/mutex_spec.rb
CHANGED
@@ -8,7 +8,7 @@ describe_moneta "optionmerger" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:Memory, :
|
11
|
+
Moneta.new(:Memory, logger: {file: File.join(make_tempdir, 'optionmerger.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -18,13 +18,13 @@ describe_moneta "optionmerger" do
|
|
18
18
|
include_context 'setup_store'
|
19
19
|
|
20
20
|
it '#with should return OptionMerger' do
|
21
|
-
options = {:
|
21
|
+
options = {optionname: :optionvalue}
|
22
22
|
merger = store.with(options)
|
23
23
|
merger.should be_instance_of(Moneta::OptionMerger)
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'saves default options' do
|
27
|
-
options = {:
|
27
|
+
options = {optionname: :optionvalue}
|
28
28
|
merger = store.with(options)
|
29
29
|
Moneta::OptionMerger::METHODS.each do |method|
|
30
30
|
merger.default_options[method].should equal(options)
|
@@ -34,42 +34,42 @@ describe_moneta "optionmerger" do
|
|
34
34
|
PREFIX = [['alpha', nil], ['beta', nil], ['alpha', 'beta']]
|
35
35
|
|
36
36
|
it 'merges options' do
|
37
|
-
merger = store.with(:
|
37
|
+
merger = store.with(opt1: :val1, opt2: :val2).with(opt2: :overwrite, opt3: :val3)
|
38
38
|
Moneta::OptionMerger::METHODS.each do |method|
|
39
|
-
merger.default_options[method].should == {:
|
39
|
+
merger.default_options[method].should == {opt1: :val1, opt2: :overwrite, opt3: :val3}
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
it 'merges options only for some methods' do
|
44
44
|
PREFIX.each do |(alpha,beta)|
|
45
|
-
options = {:
|
46
|
-
merger = store.with(options).with(:
|
45
|
+
options = {opt1: :val1, opt2: :val2, prefix: alpha}
|
46
|
+
merger = store.with(options).with(opt2: :overwrite, opt3: :val3, prefix: beta, only: :clear)
|
47
47
|
(Moneta::OptionMerger::METHODS - [:clear]).each do |method|
|
48
48
|
merger.default_options[method].should equal(options)
|
49
49
|
end
|
50
|
-
merger.default_options[:clear].should == {:
|
50
|
+
merger.default_options[:clear].should == {opt1: :val1, opt2: :overwrite, opt3: :val3, prefix: "#{alpha}#{beta}"}
|
51
51
|
|
52
|
-
merger = store.with(options).with(:
|
52
|
+
merger = store.with(options).with(opt2: :overwrite, opt3: :val3, prefix: beta, only: [:load, :store])
|
53
53
|
(Moneta::OptionMerger::METHODS - [:load, :store]).each do |method|
|
54
54
|
merger.default_options[method].should equal(options)
|
55
55
|
end
|
56
|
-
merger.default_options[:load].should == {:
|
57
|
-
merger.default_options[:store].should == {:
|
56
|
+
merger.default_options[:load].should == {opt1: :val1, opt2: :overwrite, opt3: :val3, prefix: "#{alpha}#{beta}"}
|
57
|
+
merger.default_options[:store].should == {opt1: :val1, opt2: :overwrite, opt3: :val3, prefix: "#{alpha}#{beta}"}
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
61
|
it 'merges options except for some methods' do
|
62
62
|
PREFIX.each do |(alpha,beta)|
|
63
|
-
options = {:
|
64
|
-
merger = store.with(options).with(:
|
63
|
+
options = {opt1: :val1, opt2: :val2, prefix: alpha}
|
64
|
+
merger = store.with(options).with(opt2: :overwrite, opt3: :val3, except: :clear, prefix: beta)
|
65
65
|
(Moneta::OptionMerger::METHODS - [:clear]).each do |method|
|
66
|
-
merger.default_options[method].should == {:
|
66
|
+
merger.default_options[method].should == {opt1: :val1, opt2: :overwrite, opt3: :val3, prefix: "#{alpha}#{beta}"}
|
67
67
|
end
|
68
68
|
merger.default_options[:clear].should equal(options)
|
69
69
|
|
70
|
-
merger = store.with(options).with(:
|
70
|
+
merger = store.with(options).with(opt2: :overwrite, opt3: :val3, prefix: beta, except: [:load, :store])
|
71
71
|
(Moneta::OptionMerger::METHODS - [:load, :store]).each do |method|
|
72
|
-
merger.default_options[method].should == {:
|
72
|
+
merger.default_options[method].should == {opt1: :val1, opt2: :overwrite, opt3: :val3, prefix: "#{alpha}#{beta}"}
|
73
73
|
end
|
74
74
|
merger.default_options[:load].should equal(options)
|
75
75
|
merger.default_options[:store].should equal(options)
|
@@ -77,29 +77,29 @@ describe_moneta "optionmerger" do
|
|
77
77
|
end
|
78
78
|
|
79
79
|
it 'has method #raw' do
|
80
|
-
store.raw.default_options.should == {:
|
80
|
+
store.raw.default_options.should == {store:{raw:true},create:{raw:true},load:{raw:true},delete:{raw:true}}
|
81
81
|
store.raw.should equal(store.raw.raw)
|
82
82
|
end
|
83
83
|
|
84
84
|
it 'has method #expires' do
|
85
|
-
store.expires(10).default_options.should == {:
|
85
|
+
store.expires(10).default_options.should == {store:{expires:10},create:{expires:10},increment:{expires:10}}
|
86
86
|
end
|
87
87
|
|
88
88
|
it 'has method #prefix' do
|
89
|
-
store.prefix('a').default_options.should == {:
|
90
|
-
:
|
89
|
+
store.prefix('a').default_options.should == {store:{prefix:'a'},load:{prefix:'a'},create:{prefix:'a'},
|
90
|
+
delete:{prefix:'a'},key?: {prefix:'a'},increment:{prefix:'a'}}
|
91
91
|
|
92
|
-
store.prefix('a').prefix('b').default_options.should == {:
|
93
|
-
:
|
92
|
+
store.prefix('a').prefix('b').default_options.should == {store:{prefix:'ab'},load:{prefix:'ab'},create:{prefix:'ab'},
|
93
|
+
delete:{prefix:'ab'},key?: {prefix:'ab'},increment:{prefix:'ab'}}
|
94
94
|
|
95
|
-
store.raw.prefix('b').default_options.should == {:
|
95
|
+
store.raw.prefix('b').default_options.should == {store:{raw:true,prefix:'b'},load:{raw:true,prefix:'b'},create:{raw:true,prefix:'b'},delete:{raw:true,prefix:'b'},key?: {prefix:'b'},increment:{prefix:'b'}}
|
96
96
|
|
97
|
-
store.prefix('a').raw.default_options.should == {:
|
97
|
+
store.prefix('a').raw.default_options.should == {store:{raw:true,prefix:'a'},load:{raw:true,prefix:'a'},create:{raw:true,prefix:'a'},delete:{raw:true,prefix:'a'},key?: {prefix:'a'},increment:{prefix:'a'}}
|
98
98
|
end
|
99
99
|
|
100
100
|
it 'supports adding proxis using #with' do
|
101
|
-
compressed_store = store.with(:
|
102
|
-
use :Transformer, :
|
101
|
+
compressed_store = store.with(prefix: 'compressed') do
|
102
|
+
use :Transformer, value: :zlib
|
103
103
|
end
|
104
104
|
store['key'] = 'uncompressed value'
|
105
105
|
compressed_store['key'] = 'compressed value'
|
data/spec/moneta/pool_spec.rb
CHANGED
@@ -9,8 +9,8 @@ describe_moneta "shared_tcp" do
|
|
9
9
|
|
10
10
|
def new_store
|
11
11
|
Moneta.build do
|
12
|
-
use(:Shared, :
|
13
|
-
adapter :PStore, :
|
12
|
+
use(:Shared, port: 9001) do
|
13
|
+
adapter :PStore, file: File.join(make_tempdir, 'shared_tcp')
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -9,8 +9,8 @@ describe_moneta "shared_unix" do
|
|
9
9
|
|
10
10
|
def new_store
|
11
11
|
Moneta.build do
|
12
|
-
use(:Shared, :
|
13
|
-
adapter :PStore, :
|
12
|
+
use(:Shared, socket: File.join(make_tempdir, 'shared_unix.socket')) do
|
13
|
+
adapter :PStore, file: File.join(make_tempdir, 'shared_unix')
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -12,7 +12,7 @@ describe_moneta "stack_file_memory" do
|
|
12
12
|
use(:Stack) do
|
13
13
|
add(Moneta.new(:Null))
|
14
14
|
add(Moneta::Adapters::Null.new)
|
15
|
-
add { adapter :File, :
|
15
|
+
add { adapter :File, dir: File.join(make_tempdir, "stack_file_memory") }
|
16
16
|
add { adapter :Memory }
|
17
17
|
end
|
18
18
|
end
|
@@ -11,7 +11,7 @@ describe_moneta "stack_memory_file" do
|
|
11
11
|
Moneta.build do
|
12
12
|
use(:Stack) do
|
13
13
|
add { adapter :Memory }
|
14
|
-
add { adapter :File, :
|
14
|
+
add { adapter :File, dir: File.join(make_tempdir, "stack_memory_file") }
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -8,7 +8,7 @@ describe_moneta "standard_activerecord" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:ActiveRecord, :
|
11
|
+
Moneta.new(:ActiveRecord, table: 'standard_activerecord', connection: { adapter: (defined?(JRUBY_VERSION) ? 'jdbcmysql' : 'mysql2'), database: 'moneta', username: 'root' }, logger: {file: File.join(make_tempdir, 'standard_activerecord.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_activerecord_with_expires" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:ActiveRecord, :
|
11
|
+
Moneta.new(:ActiveRecord, table: 'standard_activerecord_with_expires', connection: { adapter: (defined?(JRUBY_VERSION) ? 'jdbcmysql' : 'mysql2'), database: 'moneta', username: 'root' }, expires: true, logger: {file: File.join(make_tempdir, 'standard_activerecord_with_expires.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_cassandra" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:Cassandra, :
|
11
|
+
Moneta.new(:Cassandra, keyspace: "simple_cassandra", logger: {file: File.join(make_tempdir, 'standard_cassandra.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -9,7 +9,7 @@ describe_moneta "standard_client_tcp" do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def new_store
|
12
|
-
Moneta.new(:Client, :
|
12
|
+
Moneta.new(:Client, logger: {file: File.join(make_tempdir, 'standard_client_tcp.log')})
|
13
13
|
end
|
14
14
|
|
15
15
|
def load_value(value)
|
@@ -3,13 +3,13 @@
|
|
3
3
|
require 'helper'
|
4
4
|
|
5
5
|
describe_moneta "standard_client_unix" do
|
6
|
-
start_server(Moneta::Adapters::Memory.new, :
|
6
|
+
start_server(Moneta::Adapters::Memory.new, socket: File.join(make_tempdir, 'standard_client_unix'))
|
7
7
|
def features
|
8
8
|
[:create, :increment]
|
9
9
|
end
|
10
10
|
|
11
11
|
def new_store
|
12
|
-
Moneta.new(:Client, :
|
12
|
+
Moneta.new(:Client, socket: File.join(make_tempdir, 'standard_client_unix'), logger: {file: File.join(make_tempdir, 'standard_client_unix.log')})
|
13
13
|
end
|
14
14
|
|
15
15
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_couch" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:Couch, :
|
11
|
+
Moneta.new(:Couch, db: 'standard_couch', logger: {file: File.join(make_tempdir, 'standard_couch.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_couch_with_expires" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:Couch, :
|
11
|
+
Moneta.new(:Couch, db: 'standard_couch_with_expires', expires: true, logger: {file: File.join(make_tempdir, 'standard_couch_with_expires.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -4,13 +4,13 @@ require 'helper'
|
|
4
4
|
|
5
5
|
describe_moneta "standard_datamapper" do
|
6
6
|
require 'dm-core'
|
7
|
-
DataMapper.setup(:default, :
|
7
|
+
DataMapper.setup(:default, adapter: :in_memory)
|
8
8
|
def features
|
9
9
|
[:create]
|
10
10
|
end
|
11
11
|
|
12
12
|
def new_store
|
13
|
-
Moneta.new(:DataMapper, :
|
13
|
+
Moneta.new(:DataMapper, setup: "mysql://root:@localhost/moneta", table: "simple_datamapper", logger: {file: File.join(make_tempdir, 'standard_datamapper.log')})
|
14
14
|
end
|
15
15
|
|
16
16
|
def load_value(value)
|
@@ -4,13 +4,13 @@ require 'helper'
|
|
4
4
|
|
5
5
|
describe_moneta "standard_datamapper_with_expires" do
|
6
6
|
require 'dm-core'
|
7
|
-
DataMapper.setup(:default, :
|
7
|
+
DataMapper.setup(:default, adapter: :in_memory)
|
8
8
|
def features
|
9
9
|
[:create, :expires]
|
10
10
|
end
|
11
11
|
|
12
12
|
def new_store
|
13
|
-
Moneta.new(:DataMapper, :
|
13
|
+
Moneta.new(:DataMapper, setup: "mysql://root:@localhost/moneta", table: "simple_datamapper_with_expires", expires: true, logger: {file: File.join(make_tempdir, 'standard_datamapper_with_expires.log')})
|
14
14
|
end
|
15
15
|
|
16
16
|
def load_value(value)
|
@@ -4,13 +4,13 @@ require 'helper'
|
|
4
4
|
|
5
5
|
describe_moneta "standard_datamapper_with_repository" do
|
6
6
|
require 'dm-core'
|
7
|
-
DataMapper.setup(:default, :
|
7
|
+
DataMapper.setup(:default, adapter: :in_memory)
|
8
8
|
def features
|
9
9
|
[:create]
|
10
10
|
end
|
11
11
|
|
12
12
|
def new_store
|
13
|
-
Moneta.new(:DataMapper, :
|
13
|
+
Moneta.new(:DataMapper, repository: :repo, setup: "mysql://root:@localhost/moneta", table: "simple_datamapper_with_repository", logger: {file: File.join(make_tempdir, 'standard_datamapper_with_repository.log')})
|
14
14
|
end
|
15
15
|
|
16
16
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_daybreak" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:Daybreak, :
|
11
|
+
Moneta.new(:Daybreak, file: File.join(make_tempdir, "simple_daybreak"), logger: {file: File.join(make_tempdir, 'standard_daybreak.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_daybreak_with_expires" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:Daybreak, :
|
11
|
+
Moneta.new(:Daybreak, file: File.join(make_tempdir, "simple_daybreak_with_expires"), expires: true, logger: {file: File.join(make_tempdir, 'standard_daybreak_with_expires.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_dbm" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:DBM, :
|
11
|
+
Moneta.new(:DBM, file: File.join(make_tempdir, "simple_dbm"), logger: {file: File.join(make_tempdir, 'standard_dbm.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_dbm_with_expires" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:DBM, :
|
11
|
+
Moneta.new(:DBM, file: File.join(make_tempdir, "simple_dbm_with_expires"), expires: true, logger: {file: File.join(make_tempdir, 'standard_dbm_with_expires.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_file" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:File, :
|
11
|
+
Moneta.new(:File, dir: File.join(make_tempdir, "simple_file"), logger: {file: File.join(make_tempdir, 'standard_file.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_file_with_expires" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:File, :
|
11
|
+
Moneta.new(:File, dir: File.join(make_tempdir, "simple_file_with_expires"), expires: true, logger: {file: File.join(make_tempdir, 'standard_file_with_expires.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -10,10 +10,10 @@ describe_moneta "standard_fog" do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def new_store
|
13
|
-
Moneta.new(:Fog, :
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
13
|
+
Moneta.new(:Fog, aws_access_key_id: 'fake_access_key_id',
|
14
|
+
aws_secret_access_key: 'fake_secret_access_key',
|
15
|
+
provider: 'AWS',
|
16
|
+
dir: 'standard_fog', logger: {file: File.join(make_tempdir, 'standard_fog.log')})
|
17
17
|
end
|
18
18
|
|
19
19
|
def load_value(value)
|
@@ -10,11 +10,11 @@ describe_moneta "standard_fog_with_expires" do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def new_store
|
13
|
-
Moneta.new(:Fog, :
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
13
|
+
Moneta.new(:Fog, aws_access_key_id: 'fake_access_key_id',
|
14
|
+
aws_secret_access_key: 'fake_secret_access_key',
|
15
|
+
provider: 'AWS',
|
16
|
+
dir: 'standard_fog_with_expires',
|
17
|
+
expires: true, logger: {file: File.join(make_tempdir, 'standard_fog_with_expires.log')})
|
18
18
|
end
|
19
19
|
|
20
20
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_gdbm" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:GDBM, :
|
11
|
+
Moneta.new(:GDBM, file: File.join(make_tempdir, "simple_gdbm"), logger: {file: File.join(make_tempdir, 'standard_gdbm.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_gdbm_with_expires" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:GDBM, :
|
11
|
+
Moneta.new(:GDBM, file: File.join(make_tempdir, "simple_gdbm_with_expires"), expires: true, logger: {file: File.join(make_tempdir, 'standard_gdbm_with_expires.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|
@@ -8,7 +8,7 @@ describe_moneta "standard_hashfile" do
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def new_store
|
11
|
-
Moneta.new(:HashFile, :
|
11
|
+
Moneta.new(:HashFile, dir: File.join(make_tempdir, "simple_hashfile"), logger: {file: File.join(make_tempdir, 'standard_hashfile.log')})
|
12
12
|
end
|
13
13
|
|
14
14
|
def load_value(value)
|