moneta 0.7.19 → 0.7.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGES +11 -0
- data/Gemfile +9 -0
- data/README.md +15 -2
- data/lib/moneta.rb +8 -9
- data/lib/moneta/adapters/cassandra.rb +11 -11
- data/lib/moneta/adapters/lmdb.rb +93 -0
- data/lib/moneta/adapters/lruhash.rb +16 -10
- data/lib/moneta/adapters/mongo.rb +2 -3
- data/lib/moneta/adapters/sequel.rb +12 -5
- data/lib/moneta/cache.rb +1 -2
- data/lib/moneta/proxy.rb +1 -0
- data/lib/moneta/synchronize.rb +2 -3
- data/lib/moneta/transformer/config.rb +5 -3
- data/lib/moneta/utils.rb +8 -0
- data/lib/moneta/version.rb +1 -1
- data/script/benchmarks +1 -0
- data/script/generate-specs +139 -92
- data/script/travis-logs +2 -1
- data/spec/helper.rb +2 -2
- data/spec/moneta/adapter_activerecord_exisiting_connection_spec.rb +5 -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 +4 -0
- data/spec/moneta/adapter_couch_spec.rb +12 -11
- 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 +5 -0
- data/spec/moneta/adapter_leveldb_spec.rb +5 -0
- data/spec/moneta/adapter_lmdb_spec.rb +32 -0
- data/spec/moneta/adapter_lmdb_with_db_spec.rb +32 -0
- data/spec/moneta/adapter_localmemcache_spec.rb +5 -0
- data/spec/moneta/adapter_lruhash_spec.rb +4 -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 +42 -0
- data/spec/moneta/adapter_mongo_spec.rb +12 -0
- data/spec/moneta/adapter_mongo_with_default_expires_spec.rb +12 -0
- data/spec/moneta/adapter_pstore_spec.rb +57 -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_tokyotyrant_spec.rb +5 -0
- data/spec/moneta/adapter_yaml_spec.rb +1 -0
- data/spec/moneta/cache_file_memory_spec.rb +5 -0
- data/spec/moneta/cache_memory_null_spec.rb +4 -0
- data/spec/moneta/expires_file_spec.rb +5 -0
- data/spec/moneta/expires_memory_spec.rb +42 -0
- data/spec/moneta/expires_memory_with_default_expires_spec.rb +42 -0
- data/spec/moneta/lock_spec.rb +42 -0
- data/spec/moneta/mutex_spec.rb +1 -0
- data/spec/moneta/null_adapter_spec.rb +16 -0
- data/spec/moneta/optionmerger_spec.rb +1 -0
- data/spec/moneta/pool_spec.rb +5 -0
- data/spec/moneta/proxy_expires_memory_spec.rb +42 -0
- data/spec/moneta/proxy_redis_spec.rb +5 -0
- data/spec/moneta/semaphore_spec.rb +1 -0
- data/spec/moneta/shared_tcp_spec.rb +5 -0
- data/spec/moneta/shared_unix_spec.rb +5 -0
- data/spec/moneta/stack_file_memory_spec.rb +5 -0
- data/spec/moneta/stack_memory_file_spec.rb +5 -0
- data/spec/moneta/{simple_activerecord_spec.rb → standard_activerecord_spec.rb} +59 -2
- data/spec/moneta/{simple_activerecord_with_expires_spec.rb → standard_activerecord_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_cassandra_spec.rb → standard_cassandra_spec.rb} +59 -2
- data/spec/moneta/{simple_client_tcp_spec.rb → standard_client_tcp_spec.rb} +59 -2
- data/spec/moneta/standard_client_unix_spec.rb +254 -0
- data/spec/moneta/{simple_couch_spec.rb → standard_couch_spec.rb} +59 -2
- data/spec/moneta/{simple_couch_with_expires_spec.rb → standard_couch_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_datamapper_spec.rb → standard_datamapper_spec.rb} +59 -2
- data/spec/moneta/{simple_datamapper_with_expires_spec.rb → standard_datamapper_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_datamapper_with_repository_spec.rb → standard_datamapper_with_repository_spec.rb} +59 -2
- data/spec/moneta/{simple_daybreak_spec.rb → standard_daybreak_spec.rb} +59 -2
- data/spec/moneta/{simple_daybreak_with_expires_spec.rb → standard_daybreak_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_dbm_spec.rb → standard_dbm_spec.rb} +59 -2
- data/spec/moneta/{simple_dbm_with_expires_spec.rb → standard_dbm_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_file_spec.rb → standard_file_spec.rb} +59 -2
- data/spec/moneta/{simple_file_with_expires_spec.rb → standard_file_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_fog_spec.rb → standard_fog_spec.rb} +59 -2
- data/spec/moneta/{simple_fog_with_expires_spec.rb → standard_fog_with_expires_spec.rb} +60 -3
- data/spec/moneta/{simple_gdbm_spec.rb → standard_gdbm_spec.rb} +59 -2
- data/spec/moneta/{simple_gdbm_with_expires_spec.rb → standard_gdbm_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_hashfile_spec.rb → standard_hashfile_spec.rb} +59 -2
- data/spec/moneta/{simple_hashfile_with_expires_spec.rb → standard_hashfile_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_hbase_spec.rb → standard_hbase_spec.rb} +59 -2
- data/spec/moneta/{simple_hbase_with_expires_spec.rb → standard_hbase_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_kyotocabinet_spec.rb → standard_kyotocabinet_spec.rb} +59 -2
- data/spec/moneta/{simple_kyotocabinet_with_expires_spec.rb → standard_kyotocabinet_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_leveldb_spec.rb → standard_leveldb_spec.rb} +59 -2
- data/spec/moneta/{simple_leveldb_with_expires_spec.rb → standard_leveldb_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_client_unix_spec.rb → standard_lmdb_spec.rb} +59 -5
- data/spec/moneta/standard_lmdb_with_expires_spec.rb +253 -0
- data/spec/moneta/{simple_localmemcache_spec.rb → standard_localmemcache_spec.rb} +59 -2
- data/spec/moneta/{simple_localmemcache_with_expires_spec.rb → standard_localmemcache_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_lruhash_spec.rb → standard_lruhash_spec.rb} +44 -2
- data/spec/moneta/{simple_lruhash_with_expires_spec.rb → standard_lruhash_with_expires_spec.rb} +44 -2
- data/spec/moneta/{simple_memcached_dalli_spec.rb → standard_memcached_dalli_spec.rb} +59 -2
- data/spec/moneta/{simple_memcached_native_spec.rb → standard_memcached_native_spec.rb} +59 -2
- data/spec/moneta/{simple_memcached_spec.rb → standard_memcached_spec.rb} +59 -2
- data/spec/moneta/{simple_memory_spec.rb → standard_memory_spec.rb} +44 -2
- data/spec/moneta/{simple_memory_with_compress_spec.rb → standard_memory_with_compress_spec.rb} +44 -2
- data/spec/moneta/{simple_memory_with_expires_spec.rb → standard_memory_with_expires_spec.rb} +44 -2
- data/spec/moneta/{simple_memory_with_json_key_serializer_spec.rb → standard_memory_with_json_key_serializer_spec.rb} +12 -2
- data/spec/moneta/{simple_memory_with_json_serializer_spec.rb → standard_memory_with_json_serializer_spec.rb} +4 -3
- data/spec/moneta/{simple_memory_with_json_value_serializer_spec.rb → standard_memory_with_json_value_serializer_spec.rb} +12 -3
- data/spec/moneta/{simple_memory_with_prefix_spec.rb → standard_memory_with_prefix_spec.rb} +44 -2
- data/spec/moneta/{simple_memory_with_snappy_compress_spec.rb → standard_memory_with_snappy_compress_spec.rb} +44 -2
- data/spec/moneta/{simple_mongo_spec.rb → standard_mongo_spec.rb} +59 -2
- data/spec/moneta/{simple_null_spec.rb → standard_null_spec.rb} +29 -2
- data/spec/moneta/{simple_pstore_spec.rb → standard_pstore_spec.rb} +59 -2
- data/spec/moneta/{simple_pstore_with_expires_spec.rb → standard_pstore_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_redis_spec.rb → standard_redis_spec.rb} +59 -2
- data/spec/moneta/{simple_restclient_spec.rb → standard_restclient_spec.rb} +59 -2
- data/spec/moneta/{simple_riak_spec.rb → standard_riak_spec.rb} +59 -2
- data/spec/moneta/{simple_riak_with_expires_spec.rb → standard_riak_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_sdbm_spec.rb → standard_sdbm_spec.rb} +59 -2
- data/spec/moneta/{simple_sdbm_with_expires_spec.rb → standard_sdbm_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_sequel_spec.rb → standard_sequel_spec.rb} +60 -3
- data/spec/moneta/{simple_sequel_with_expires_spec.rb → standard_sequel_with_expires_spec.rb} +60 -3
- data/spec/moneta/{simple_sqlite_spec.rb → standard_sqlite_spec.rb} +59 -2
- data/spec/moneta/{simple_sqlite_with_expires_spec.rb → standard_sqlite_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_tdb_spec.rb → standard_tdb_spec.rb} +59 -2
- data/spec/moneta/{simple_tdb_with_expires_spec.rb → standard_tdb_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_tokyocabinet_spec.rb → standard_tokyocabinet_spec.rb} +59 -2
- data/spec/moneta/{simple_tokyocabinet_with_expires_spec.rb → standard_tokyocabinet_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_tokyotyrant_spec.rb → standard_tokyotyrant_spec.rb} +59 -2
- data/spec/moneta/{simple_tokyotyrant_with_expires_spec.rb → standard_tokyotyrant_with_expires_spec.rb} +59 -2
- data/spec/moneta/{simple_yaml_spec.rb → standard_yaml_spec.rb} +59 -2
- data/spec/moneta/{simple_yaml_with_expires_spec.rb → standard_yaml_with_expires_spec.rb} +59 -2
- data/spec/moneta/transformer_bencode_spec.rb +1 -0
- data/spec/moneta/transformer_bert_spec.rb +1 -0
- data/spec/moneta/transformer_bson_spec.rb +1 -0
- data/spec/moneta/transformer_bzip2_spec.rb +4 -0
- data/spec/moneta/transformer_json_spec.rb +2 -1
- data/spec/moneta/transformer_key_inspect_spec.rb +10 -0
- data/spec/moneta/transformer_key_marshal_spec.rb +42 -0
- data/spec/moneta/transformer_key_to_s_spec.rb +10 -0
- data/spec/moneta/transformer_key_yaml_spec.rb +42 -0
- data/spec/moneta/transformer_lz4_spec.rb +4 -0
- data/spec/moneta/transformer_lzma_spec.rb +4 -0
- data/spec/moneta/transformer_lzo_spec.rb +4 -0
- data/spec/moneta/transformer_marshal_base64_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_city128_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_city32_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_city64_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_escape_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_hex_spec.rb +194 -0
- data/spec/moneta/transformer_marshal_hmac_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_md5_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_md5_spread_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_prefix_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_qp_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_rmd160_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_sha1_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_sha256_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_sha384_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_sha512_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_truncate_spec.rb +42 -0
- data/spec/moneta/transformer_marshal_uuencode_spec.rb +42 -0
- data/spec/moneta/transformer_msgpack_spec.rb +1 -0
- data/spec/moneta/transformer_ox_spec.rb +42 -0
- data/spec/moneta/transformer_php_spec.rb +55 -0
- data/spec/moneta/transformer_quicklz_spec.rb +4 -0
- data/spec/moneta/transformer_snappy_spec.rb +4 -0
- data/spec/moneta/transformer_tnet_spec.rb +1 -0
- data/spec/moneta/transformer_value_marshal_spec.rb +42 -0
- data/spec/moneta/transformer_value_yaml_spec.rb +42 -0
- data/spec/moneta/transformer_yaml_spec.rb +42 -0
- data/spec/moneta/transformer_zlib_spec.rb +4 -0
- data/spec/moneta/weak_create_spec.rb +5 -0
- data/spec/moneta/weak_increment_spec.rb +5 -0
- data/spec/monetaspecs.rb +26531 -16522
- metadata +145 -133
- data/script/kill-travis +0 -16
data/lib/moneta/utils.rb
CHANGED
@@ -4,6 +4,7 @@ module Moneta
|
|
4
4
|
extend self
|
5
5
|
|
6
6
|
def without(hash, *keys)
|
7
|
+
return hash if hash.empty?
|
7
8
|
if keys.any? {|k| hash.include?(k) }
|
8
9
|
hash = hash.dup
|
9
10
|
keys.each {|k| hash.delete(k) }
|
@@ -11,6 +12,13 @@ module Moneta
|
|
11
12
|
hash
|
12
13
|
end
|
13
14
|
|
15
|
+
def only(hash, *keys)
|
16
|
+
return hash if hash.empty?
|
17
|
+
ret = {}
|
18
|
+
keys.each {|k| ret[k] = hash[k] }
|
19
|
+
ret
|
20
|
+
end
|
21
|
+
|
14
22
|
def to_int(value)
|
15
23
|
intvalue = value.to_i
|
16
24
|
raise "#{value.inspect} is not an integer value" unless value == nil || intvalue.to_s == value.to_s
|
data/lib/moneta/version.rb
CHANGED
data/script/benchmarks
CHANGED
data/script/generate-specs
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
2
3
|
|
3
4
|
PATH = File.expand_path(File.join(__FILE__, '..', '..', 'spec'))
|
4
5
|
|
@@ -7,8 +8,8 @@ class Specs
|
|
7
8
|
|
8
9
|
def initialize(options = {})
|
9
10
|
@specs = options.delete(:specs).to_a
|
10
|
-
@key = options.delete(:key) || %w(object string hash boolean nil integer number)
|
11
|
-
@value = options.delete(:value) || %w(object string hash boolean nil integer number)
|
11
|
+
@key = options.delete(:key) || %w(object string binary hash boolean nil integer number)
|
12
|
+
@value = options.delete(:value) || %w(object string binary hash boolean nil integer number)
|
12
13
|
@features = []
|
13
14
|
[:expires, :expires_native, :increment, :create].each do |feature|
|
14
15
|
@features << feature if @specs.include?(feature)
|
@@ -21,8 +22,8 @@ class Specs
|
|
21
22
|
Specs.new({:specs => specs, :key => key, :value => value}.merge(options))
|
22
23
|
end
|
23
24
|
|
24
|
-
def
|
25
|
-
new(:key => %w(
|
25
|
+
def without_path
|
26
|
+
new(:key => key - %w(path))
|
26
27
|
end
|
27
28
|
|
28
29
|
def stringvalues_only
|
@@ -107,14 +108,14 @@ class Specs
|
|
107
108
|
end
|
108
109
|
end
|
109
110
|
|
110
|
-
ADAPTER_SPECS = Specs.new(:specs => [:null, :store, :returndifferent, :increment, :concurrent_increment, :concurrent_create, :persist, :multiprocess, :create, :features, :store_large], :key => %w(string), :value => %w(string))
|
111
|
+
ADAPTER_SPECS = Specs.new(:specs => [:null, :store, :returndifferent, :increment, :concurrent_increment, :concurrent_create, :persist, :multiprocess, :create, :features, :store_large], :key => %w(string path), :value => %w(string path))
|
111
112
|
STANDARD_SPECS = Specs.new(:specs => [:null, :store, :returndifferent, :marshallable_key, :marshallable_value, :transform_value, :increment, :concurrent_increment, :concurrent_create, :persist, :multiprocess, :create, :features, :store_large])
|
112
113
|
TRANSFORMER_SPECS = Specs.new(:specs => [:null, :store, :returndifferent, :transform_value, :increment, :create, :features, :store_large])
|
113
114
|
|
114
|
-
header = "# Generated by #{File.basename(__FILE__)}\n"
|
115
|
+
header = "# coding: binary\n# Generated by #{File.basename(__FILE__)}\n"
|
115
116
|
|
116
117
|
TESTS = {
|
117
|
-
'
|
118
|
+
'standard_client_tcp' => {
|
118
119
|
:preamble => "start_server(Moneta::Adapters::Memory.new)\n",
|
119
120
|
:store => :Client,
|
120
121
|
:specs => STANDARD_SPECS,
|
@@ -135,289 +136,299 @@ it 'supports multiple clients' do
|
|
135
136
|
end
|
136
137
|
}
|
137
138
|
},
|
138
|
-
'
|
139
|
-
:preamble => "start_server(Moneta::Adapters::Memory.new, :socket => File.join(make_tempdir, '
|
139
|
+
'standard_client_unix' => {
|
140
|
+
:preamble => "start_server(Moneta::Adapters::Memory.new, :socket => File.join(make_tempdir, 'standard_client_unix'))\n",
|
140
141
|
:store => :Client,
|
141
|
-
:options => ":socket => File.join(make_tempdir, '
|
142
|
+
:options => ":socket => File.join(make_tempdir, 'standard_client_unix')",
|
142
143
|
:specs => STANDARD_SPECS
|
143
144
|
},
|
144
|
-
'
|
145
|
+
'standard_restclient' => {
|
145
146
|
:preamble => "start_restserver\n",
|
146
147
|
:store => :RestClient,
|
147
148
|
:options => ":url => 'http://localhost:8808/moneta/'",
|
148
149
|
:specs => STANDARD_SPECS.without_increment.without_create
|
149
150
|
},
|
150
|
-
'
|
151
|
+
'standard_memory' => {
|
151
152
|
:store => :Memory,
|
152
153
|
:specs => STANDARD_SPECS.without_persist
|
153
154
|
},
|
154
|
-
'
|
155
|
+
'standard_memory_with_expires' => {
|
155
156
|
:store => :Memory,
|
156
157
|
:options => ':expires => true',
|
157
158
|
:specs => STANDARD_SPECS.with_expires.without_persist
|
158
159
|
},
|
159
|
-
'
|
160
|
+
'standard_memory_with_compress' => {
|
160
161
|
:store => :Memory,
|
161
162
|
:options => ':compress => true',
|
162
163
|
:load_value => 'Marshal.load(::Zlib::Inflate.inflate(value))',
|
163
164
|
:specs => STANDARD_SPECS.without_persist
|
164
165
|
},
|
165
|
-
'
|
166
|
+
'standard_memory_with_prefix' => {
|
166
167
|
:store => :Memory,
|
167
168
|
:options => ':prefix => "moneta"',
|
168
169
|
:specs => STANDARD_SPECS.without_persist
|
169
170
|
},
|
170
|
-
'
|
171
|
+
'standard_memory_with_json_serializer' => {
|
171
172
|
:store => :Memory,
|
172
173
|
:options => ':serializer => :json',
|
173
|
-
:load_value => '::MultiJson.load(value)
|
174
|
+
:load_value => '::MultiJson.load(value)',
|
174
175
|
:specs => STANDARD_SPECS.without_marshallable.simplekeys_only.simplevalues_only.without_persist
|
175
176
|
},
|
176
|
-
'
|
177
|
+
'standard_memory_with_json_key_serializer' => {
|
177
178
|
:store => :Memory,
|
178
179
|
:options => ':key_serializer => :json',
|
179
180
|
:specs => STANDARD_SPECS.without_marshallable_key.simplekeys_only.without_persist,
|
180
181
|
},
|
181
|
-
'
|
182
|
+
'standard_memory_with_json_value_serializer' => {
|
182
183
|
:store => :Memory,
|
183
184
|
:options => ':value_serializer => :json',
|
184
185
|
:specs => STANDARD_SPECS.without_marshallable_value.simplevalues_only.without_persist,
|
185
|
-
:load_value => '::MultiJson.load(value)
|
186
|
+
:load_value => '::MultiJson.load(value)'
|
186
187
|
},
|
187
|
-
'
|
188
|
+
'standard_memory_with_snappy_compress' => {
|
188
189
|
:store => :Memory,
|
189
190
|
:options => ':compress => :snappy',
|
190
191
|
:load_value => 'Marshal.load(::Snappy.inflate(value))',
|
191
192
|
:specs => STANDARD_SPECS.without_persist
|
192
193
|
},
|
193
|
-
'
|
194
|
+
'standard_lruhash' => {
|
194
195
|
:store => :LRUHash,
|
195
196
|
:specs => STANDARD_SPECS.without_persist
|
196
197
|
},
|
197
|
-
'
|
198
|
+
'standard_lruhash_with_expires' => {
|
198
199
|
:store => :LRUHash,
|
199
200
|
:options => ':expires => true',
|
200
201
|
:specs => STANDARD_SPECS.with_expires.without_persist,
|
201
202
|
},
|
202
|
-
'
|
203
|
+
'standard_file' => {
|
203
204
|
:store => :File,
|
204
205
|
:options => ':dir => File.join(make_tempdir, "simple_file")',
|
205
206
|
:specs => STANDARD_SPECS
|
206
207
|
},
|
207
|
-
'
|
208
|
+
'standard_file_with_expires' => {
|
208
209
|
:store => :File,
|
209
210
|
:options => ':dir => File.join(make_tempdir, "simple_file_with_expires"), :expires => true',
|
210
211
|
:specs => STANDARD_SPECS.with_expires
|
211
212
|
},
|
212
|
-
'
|
213
|
+
'standard_hashfile' => {
|
213
214
|
:store => :HashFile,
|
214
215
|
:options => ':dir => File.join(make_tempdir, "simple_hashfile")',
|
215
216
|
:specs => STANDARD_SPECS
|
216
217
|
},
|
217
|
-
'
|
218
|
+
'standard_hashfile_with_expires' => {
|
218
219
|
:store => :HashFile,
|
219
220
|
:options => ':dir => File.join(make_tempdir, "simple_hashfile_with_expires"), :expires => true',
|
220
221
|
:specs => STANDARD_SPECS.with_expires
|
221
222
|
},
|
222
|
-
'
|
223
|
+
'standard_cassandra' => {
|
223
224
|
:store => :Cassandra,
|
224
225
|
:options => ':keyspace => "simple_cassandra"',
|
225
226
|
:specs => STANDARD_SPECS.without_increment.without_create.with_native_expires,
|
226
227
|
},
|
227
|
-
'
|
228
|
+
'standard_hbase' => {
|
228
229
|
:store => :HBase,
|
229
230
|
:options => ':table => "simple_hbase"',
|
230
231
|
:specs => STANDARD_SPECS.without_create
|
231
232
|
},
|
232
|
-
'
|
233
|
+
'standard_hbase_with_expires' => {
|
233
234
|
:store => :HBase,
|
234
235
|
:options => ':table => "simple_hbase", :expires => true',
|
235
236
|
:specs => STANDARD_SPECS.with_expires,
|
236
237
|
},
|
237
|
-
'
|
238
|
+
'standard_dbm' => {
|
238
239
|
:store => :DBM,
|
239
240
|
:options => ':file => File.join(make_tempdir, "simple_dbm")',
|
240
241
|
:specs => STANDARD_SPECS.without_multiprocess
|
241
242
|
},
|
242
|
-
'
|
243
|
+
'standard_dbm_with_expires' => {
|
243
244
|
:store => :DBM,
|
244
245
|
:options => ':file => File.join(make_tempdir, "simple_dbm_with_expires"), :expires => true',
|
245
246
|
:specs => STANDARD_SPECS.without_multiprocess.with_expires
|
246
247
|
},
|
247
|
-
'
|
248
|
+
'standard_tdb' => {
|
248
249
|
:store => :TDB,
|
249
250
|
:options => ':file => File.join(make_tempdir, "simple_tdb")',
|
250
251
|
:specs => STANDARD_SPECS.without_multiprocess
|
251
252
|
},
|
252
|
-
'
|
253
|
+
'standard_tdb_with_expires' => {
|
253
254
|
:store => :TDB,
|
254
255
|
:options => ':file => File.join(make_tempdir, "simple_tdb_with_expires"), :expires => true',
|
255
256
|
:specs => STANDARD_SPECS.without_multiprocess.with_expires
|
256
257
|
},
|
257
|
-
'
|
258
|
+
'standard_daybreak' => {
|
258
259
|
:store => :Daybreak,
|
259
260
|
:options => ':file => File.join(make_tempdir, "simple_daybreak")',
|
260
261
|
:specs => STANDARD_SPECS.without_multiprocess
|
261
262
|
},
|
262
|
-
'
|
263
|
+
'standard_daybreak_with_expires' => {
|
263
264
|
:store => :Daybreak,
|
264
265
|
:options => ':file => File.join(make_tempdir, "simple_daybreak_with_expires"), :expires => true',
|
265
266
|
:specs => STANDARD_SPECS.without_multiprocess.with_expires
|
266
267
|
},
|
267
|
-
'
|
268
|
+
'standard_gdbm' => {
|
268
269
|
:store => :GDBM,
|
269
270
|
:options => ':file => File.join(make_tempdir, "simple_gdbm")',
|
270
271
|
:specs => STANDARD_SPECS.without_multiprocess
|
271
272
|
},
|
272
|
-
'
|
273
|
+
'standard_gdbm_with_expires' => {
|
273
274
|
:store => :GDBM,
|
274
275
|
:options => ':file => File.join(make_tempdir, "simple_gdbm_with_expires"), :expires => true',
|
275
276
|
:specs => STANDARD_SPECS.without_multiprocess.with_expires
|
276
277
|
},
|
277
|
-
'
|
278
|
+
'standard_sdbm' => {
|
278
279
|
:store => :SDBM,
|
279
280
|
:options => ':file => File.join(make_tempdir, "simple_sdbm")',
|
280
281
|
:specs => STANDARD_SPECS.without_multiprocess.without_large
|
281
282
|
},
|
282
|
-
'
|
283
|
+
'standard_sdbm_with_expires' => {
|
283
284
|
:store => :SDBM,
|
284
285
|
:options => ':file => File.join(make_tempdir, "simple_sdbm_with_expires"), :expires => true',
|
285
286
|
:specs => STANDARD_SPECS.without_multiprocess.with_expires.without_large
|
286
287
|
},
|
287
|
-
'
|
288
|
+
'standard_leveldb' => {
|
288
289
|
:store => :LevelDB,
|
289
290
|
:options => ':dir => File.join(make_tempdir, "simple_leveldb")',
|
290
291
|
:specs => STANDARD_SPECS.without_multiprocess
|
291
292
|
},
|
292
|
-
'
|
293
|
+
'standard_leveldb_with_expires' => {
|
293
294
|
:store => :LevelDB,
|
294
295
|
:options => ':dir => File.join(make_tempdir, "simple_leveldb_with_expires"), :expires => true',
|
295
296
|
:specs => STANDARD_SPECS.without_multiprocess.with_expires
|
296
297
|
},
|
297
|
-
'
|
298
|
+
'standard_lmdb' => {
|
299
|
+
:store => :LMDB,
|
300
|
+
:options => ':dir => File.join(make_tempdir, "simple_lmdb")',
|
301
|
+
:specs => STANDARD_SPECS.without_concurrent
|
302
|
+
},
|
303
|
+
'standard_lmdb_with_expires' => {
|
304
|
+
:store => :LMDB,
|
305
|
+
:options => ':dir => File.join(make_tempdir, "simple_lmdb_with_expires"), :expires => true',
|
306
|
+
:specs => STANDARD_SPECS.without_concurrent.with_expires
|
307
|
+
},
|
308
|
+
'standard_pstore' => {
|
298
309
|
:store => :PStore,
|
299
310
|
:options => ':file => File.join(make_tempdir, "simple_pstore")',
|
300
311
|
:load_value => 'value',
|
301
312
|
:specs => STANDARD_SPECS
|
302
313
|
},
|
303
|
-
'
|
314
|
+
'standard_pstore_with_expires' => {
|
304
315
|
:store => :PStore,
|
305
316
|
:options => ':file => File.join(make_tempdir, "simple_pstore_with_expires"), :expires => true',
|
306
317
|
:load_value => 'value',
|
307
318
|
:specs => STANDARD_SPECS.with_expires
|
308
319
|
},
|
309
|
-
'
|
320
|
+
'standard_yaml' => {
|
310
321
|
:store => :YAML,
|
311
322
|
:options => ':file => File.join(make_tempdir, "simple_yaml")',
|
312
323
|
:specs => STANDARD_SPECS.without_marshallable_value.without_concurrent,
|
313
324
|
:load_value => 'value'
|
314
325
|
},
|
315
|
-
'
|
326
|
+
'standard_yaml_with_expires' => {
|
316
327
|
:store => :YAML,
|
317
328
|
:options => ':file => File.join(make_tempdir, "simple_yaml_with_expires"), :expires => true',
|
318
329
|
:specs => STANDARD_SPECS.without_marshallable_value.with_expires.without_concurrent,
|
319
330
|
:load_value => 'value'
|
320
331
|
},
|
321
|
-
'
|
332
|
+
'standard_localmemcache' => {
|
322
333
|
:store => :LocalMemCache,
|
323
334
|
:options => ':file => File.join(make_tempdir, "simple_localmemcache")',
|
324
335
|
:specs => STANDARD_SPECS.without_increment.without_create
|
325
336
|
},
|
326
|
-
'
|
337
|
+
'standard_localmemcache_with_expires' => {
|
327
338
|
:store => :LocalMemCache,
|
328
339
|
:options => ':file => File.join(make_tempdir, "simple_localmemcache_with_expires"), :expires => true',
|
329
340
|
:specs => STANDARD_SPECS.without_increment.without_create.with_expires
|
330
341
|
},
|
331
|
-
'
|
342
|
+
'standard_tokyocabinet' => {
|
332
343
|
:store => :TokyoCabinet,
|
333
344
|
:options => ':file => File.join(make_tempdir, "simple_tokyocabinet")',
|
334
345
|
:specs => STANDARD_SPECS.without_multiprocess
|
335
346
|
},
|
336
|
-
'
|
347
|
+
'standard_tokyocabinet_with_expires' => {
|
337
348
|
:store => :TokyoCabinet,
|
338
349
|
:options => ':file => File.join(make_tempdir, "simple_tokyocabinet_with_expires"), :expires => true',
|
339
350
|
:specs => STANDARD_SPECS.without_multiprocess.with_expires
|
340
351
|
},
|
341
|
-
'
|
352
|
+
'standard_tokyotyrant' => {
|
342
353
|
:store => :TokyoTyrant,
|
343
354
|
:specs => STANDARD_SPECS
|
344
355
|
},
|
345
|
-
'
|
356
|
+
'standard_tokyotyrant_with_expires' => {
|
346
357
|
:store => :TokyoTyrant,
|
347
358
|
:options => ':expires => true',
|
348
359
|
:specs => STANDARD_SPECS.with_expires
|
349
360
|
},
|
350
|
-
'
|
361
|
+
'standard_kyotocabinet' => {
|
351
362
|
:store => :KyotoCabinet,
|
352
363
|
:options => ':file => File.join(make_tempdir, "simple_kyotocabinet.kch")',
|
353
364
|
:specs => STANDARD_SPECS.without_multiprocess
|
354
365
|
},
|
355
|
-
'
|
366
|
+
'standard_kyotocabinet_with_expires' => {
|
356
367
|
:store => :KyotoCabinet,
|
357
368
|
:options => ':file => File.join(make_tempdir, "simple_kyotocabinet_with_expires.kch"), :expires => true',
|
358
369
|
:specs => STANDARD_SPECS.without_multiprocess.with_expires
|
359
370
|
},
|
360
|
-
'
|
371
|
+
'standard_sqlite' => {
|
361
372
|
:store => :Sqlite,
|
362
373
|
:options => ':file => File.join(make_tempdir, "simple_sqlite")',
|
363
374
|
:specs => STANDARD_SPECS.without_concurrent
|
364
375
|
},
|
365
|
-
'
|
376
|
+
'standard_sqlite_with_expires' => {
|
366
377
|
:store => :Sqlite,
|
367
378
|
:options => ':file => File.join(make_tempdir, "simple_sqlite_with_expires"), :expires => true',
|
368
379
|
:specs => STANDARD_SPECS.with_expires.without_concurrent
|
369
380
|
},
|
370
|
-
'
|
381
|
+
'standard_redis' => {
|
371
382
|
:store => :Redis,
|
372
383
|
:specs => STANDARD_SPECS.with_native_expires,
|
373
384
|
},
|
374
|
-
'
|
385
|
+
'standard_memcached' => {
|
375
386
|
:store => :Memcached,
|
376
387
|
:specs => STANDARD_SPECS.with_native_expires,
|
377
388
|
:options => ':namespace => "simple_memcached"'
|
378
389
|
},
|
379
|
-
'
|
390
|
+
'standard_memcached_dalli' => {
|
380
391
|
:store => :MemcachedDalli,
|
381
392
|
:specs => STANDARD_SPECS.with_native_expires,
|
382
393
|
:options => ':namespace => "simple_memcached_dalli"'
|
383
394
|
},
|
384
|
-
'
|
395
|
+
'standard_memcached_native' => {
|
385
396
|
:store => :MemcachedNative,
|
386
397
|
:specs => STANDARD_SPECS.with_native_expires,
|
387
398
|
:options => ':namespace => "simple_memcached_native"'
|
388
399
|
},
|
389
|
-
'
|
400
|
+
'standard_riak' => {
|
390
401
|
:store => :Riak,
|
391
|
-
:options => ":bucket => '
|
402
|
+
:options => ":bucket => 'standard_riak'",
|
392
403
|
# We don't want Riak warnings in tests
|
393
404
|
:preamble => "require 'riak'\n\nRiak.disable_list_keys_warnings = true\n\n",
|
394
405
|
:specs => STANDARD_SPECS.without_increment.without_create
|
395
406
|
},
|
396
|
-
'
|
407
|
+
'standard_riak_with_expires' => {
|
397
408
|
:store => :Riak,
|
398
|
-
:options => ":bucket => '
|
409
|
+
:options => ":bucket => 'standard_riak_with_expires', :expires => true",
|
399
410
|
# We don't want Riak warnings in tests
|
400
411
|
:preamble => "require 'riak'\n\nRiak.disable_list_keys_warnings = true\n\n",
|
401
412
|
:specs => STANDARD_SPECS.without_increment.with_expires.without_create
|
402
413
|
},
|
403
|
-
'
|
414
|
+
'standard_couch' => {
|
404
415
|
:store => :Couch,
|
405
|
-
:options => ":db => '
|
416
|
+
:options => ":db => 'standard_couch'",
|
406
417
|
:load_value => '::Marshal.load(value.unpack(\'m\').first)',
|
407
418
|
:specs => STANDARD_SPECS.without_increment
|
408
419
|
},
|
409
|
-
'
|
420
|
+
'standard_couch_with_expires' => {
|
410
421
|
:store => :Couch,
|
411
|
-
:options => ":db => '
|
422
|
+
:options => ":db => 'standard_couch_with_expires', :expires => true",
|
412
423
|
:specs => STANDARD_SPECS.without_increment.with_expires,
|
413
424
|
:load_value => '::Marshal.load(value.unpack(\'m\').first)'
|
414
425
|
},
|
415
|
-
'
|
426
|
+
'standard_mongo' => {
|
416
427
|
:store => :Mongo,
|
417
|
-
:options => ":db => '
|
428
|
+
:options => ":db => 'standard_mongo'",
|
418
429
|
:specs => STANDARD_SPECS.with_native_expires
|
419
430
|
},
|
420
|
-
'
|
431
|
+
'standard_null' => {
|
421
432
|
:store => :Null,
|
422
433
|
:specs => STANDARD_SPECS.without_increment.without_create.without_store.without_persist
|
423
434
|
},
|
@@ -425,19 +436,19 @@ end
|
|
425
436
|
:build => 'Moneta::Adapters::Null.new',
|
426
437
|
:specs => Specs.new(:specs => [:null, :not_increment, :not_create, :not_persist])
|
427
438
|
},
|
428
|
-
'
|
439
|
+
'standard_sequel' => {
|
429
440
|
:store => :Sequel,
|
430
441
|
:options => ':db => (defined?(JRUBY_VERSION) ? "jdbc:mysql://localhost/moneta?user=root" : "mysql2://root:@localhost/moneta"), :table => "simple_sequel"',
|
431
|
-
:load_value => '::Marshal.load(value
|
442
|
+
:load_value => '::Marshal.load(value)',
|
432
443
|
:specs => STANDARD_SPECS
|
433
444
|
},
|
434
|
-
'
|
445
|
+
'standard_sequel_with_expires' => {
|
435
446
|
:store => :Sequel,
|
436
447
|
:options => ':db => (defined?(JRUBY_VERSION) ? "jdbc:mysql://localhost/moneta?user=root" : "mysql2://root:@localhost/moneta"), :table => "simple_sequel_with_expires", :expires => true',
|
437
448
|
:specs => STANDARD_SPECS.with_expires,
|
438
|
-
:load_value => '::Marshal.load(value
|
449
|
+
:load_value => '::Marshal.load(value)'
|
439
450
|
},
|
440
|
-
'
|
451
|
+
'standard_datamapper' => {
|
441
452
|
:store => :DataMapper,
|
442
453
|
:specs => STANDARD_SPECS.without_increment,
|
443
454
|
:options => ':setup => "mysql://root:@localhost/moneta", :table => "simple_datamapper"',
|
@@ -445,7 +456,7 @@ end
|
|
445
456
|
:preamble => "require 'dm-core'\nDataMapper.setup(:default, :adapter => :in_memory)\n",
|
446
457
|
:load_value => '::Marshal.load(value.unpack(\'m\').first)'
|
447
458
|
},
|
448
|
-
'
|
459
|
+
'standard_datamapper_with_expires' => {
|
449
460
|
:store => :DataMapper,
|
450
461
|
:options => ':setup => "mysql://root:@localhost/moneta", :table => "simple_datamapper_with_expires", :expires => true',
|
451
462
|
# DataMapper needs default repository to be setup
|
@@ -453,7 +464,7 @@ end
|
|
453
464
|
:specs => STANDARD_SPECS.without_increment.with_expires,
|
454
465
|
:load_value => '::Marshal.load(value.unpack(\'m\').first)'
|
455
466
|
},
|
456
|
-
'
|
467
|
+
'standard_datamapper_with_repository' => {
|
457
468
|
:store => :DataMapper,
|
458
469
|
:specs => STANDARD_SPECS.without_increment,
|
459
470
|
:options => ':repository => :repo, :setup => "mysql://root:@localhost/moneta", :table => "simple_datamapper_with_repository"',
|
@@ -461,34 +472,34 @@ end
|
|
461
472
|
:preamble => "require 'dm-core'\nDataMapper.setup(:default, :adapter => :in_memory)\n",
|
462
473
|
:load_value => '::Marshal.load(value.unpack(\'m\').first)'
|
463
474
|
},
|
464
|
-
'
|
475
|
+
'standard_activerecord' => {
|
465
476
|
:store => :ActiveRecord,
|
466
477
|
:specs => STANDARD_SPECS,
|
467
|
-
:options => ":table => '
|
478
|
+
:options => ":table => 'standard_activerecord', :connection => { :adapter => (defined?(JRUBY_VERSION) ? 'jdbcmysql' : 'mysql2'), :database => 'moneta', :username => 'root' }",
|
468
479
|
:load_value => '::Marshal.load(value.unpack(\'m\').first)'
|
469
480
|
},
|
470
|
-
'
|
481
|
+
'standard_activerecord_with_expires' => {
|
471
482
|
:store => :ActiveRecord,
|
472
|
-
:options => ":table => '
|
483
|
+
:options => ":table => 'standard_activerecord_with_expires', :connection => { :adapter => (defined?(JRUBY_VERSION) ? 'jdbcmysql' : 'mysql2'), :database => 'moneta', :username => 'root' }, :expires => true",
|
473
484
|
:specs => STANDARD_SPECS.with_expires,
|
474
485
|
:load_value => '::Marshal.load(value.unpack(\'m\').first)'
|
475
486
|
},
|
476
|
-
'
|
487
|
+
'standard_fog' => {
|
477
488
|
:store => :Fog,
|
478
489
|
:specs => STANDARD_SPECS.without_increment.without_create,
|
479
490
|
:options => ":aws_access_key_id => 'fake_access_key_id',
|
480
491
|
:aws_secret_access_key => 'fake_secret_access_key',
|
481
492
|
:provider => 'AWS',
|
482
|
-
:dir => '
|
493
|
+
:dir => 'standard_fog'",
|
483
494
|
# Put Fog into testing mode
|
484
495
|
:preamble => "require 'fog'\nFog.mock!\n"
|
485
496
|
},
|
486
|
-
'
|
497
|
+
'standard_fog_with_expires' => {
|
487
498
|
:store => :Fog,
|
488
499
|
:options => ":aws_access_key_id => 'fake_access_key_id',
|
489
500
|
:aws_secret_access_key => 'fake_secret_access_key',
|
490
501
|
:provider => 'AWS',
|
491
|
-
:dir => '
|
502
|
+
:dir => 'standard_fog_with_expires',
|
492
503
|
:expires => true",
|
493
504
|
# Put Fog into testing mode
|
494
505
|
:preamble => "require 'fog'\nFog.mock!\n",
|
@@ -767,7 +778,7 @@ end}
|
|
767
778
|
adapter :Memory
|
768
779
|
end},
|
769
780
|
:specs => TRANSFORMER_SPECS.simplekeys_only.simplevalues_only,
|
770
|
-
:load_value => '::MultiJson.load(value)
|
781
|
+
:load_value => '::MultiJson.load(value)',
|
771
782
|
:tests => %{
|
772
783
|
it 'compile transformer class' do
|
773
784
|
store.should_not be_nil
|
@@ -825,6 +836,19 @@ end},
|
|
825
836
|
it 'compile transformer class' do
|
826
837
|
store.should_not be_nil
|
827
838
|
Moneta::Transformer::OxKeyOxValue.should_not be_nil
|
839
|
+
end}
|
840
|
+
},
|
841
|
+
'transformer_php' => {
|
842
|
+
:build => %{Moneta.build do
|
843
|
+
use :Transformer, :key => :php, :value => :php
|
844
|
+
adapter :Memory
|
845
|
+
end},
|
846
|
+
:specs => TRANSFORMER_SPECS.simplekeys_only.simplevalues_only,
|
847
|
+
:load_value => '::PHP.unserialize(value)',
|
848
|
+
:tests => %{
|
849
|
+
it 'compile transformer class' do
|
850
|
+
store.should_not be_nil
|
851
|
+
Moneta::Transformer::PhpKeyPhpValue.should_not be_nil
|
828
852
|
end}
|
829
853
|
},
|
830
854
|
'transformer_tnet' => {
|
@@ -981,6 +1005,19 @@ end},
|
|
981
1005
|
it 'compile transformer class' do
|
982
1006
|
store.should_not be_nil
|
983
1007
|
Moneta::Transformer::MarshalBase64KeyMarshalBase64Value.should_not be_nil
|
1008
|
+
end}
|
1009
|
+
},
|
1010
|
+
'transformer_marshal_hex' => {
|
1011
|
+
:build => %{Moneta.build do
|
1012
|
+
use :Transformer, :key => [:marshal, :hex], :value => [:marshal, :hex]
|
1013
|
+
adapter :Memory
|
1014
|
+
end},
|
1015
|
+
:specs => STANDARD_SPECS.without_persist,
|
1016
|
+
:load_value => '::Marshal.load([value].pack(\'H*\'))',
|
1017
|
+
:tests => %{
|
1018
|
+
it 'compile transformer class' do
|
1019
|
+
store.should_not be_nil
|
1020
|
+
Moneta::Transformer::MarshalHexKeyMarshalHexValue.should_not be_nil
|
984
1021
|
end}
|
985
1022
|
},
|
986
1023
|
'transformer_marshal_prefix' => {
|
@@ -1234,7 +1271,7 @@ end}
|
|
1234
1271
|
},
|
1235
1272
|
'adapter_couch' => {
|
1236
1273
|
:build => "Moneta::Adapters::Couch.new(:db => 'adapter_couch')",
|
1237
|
-
:specs => ADAPTER_SPECS.without_increment.simplevalues_only.
|
1274
|
+
:specs => ADAPTER_SPECS.without_increment.simplevalues_only.without_path
|
1238
1275
|
},
|
1239
1276
|
'adapter_datamapper' => {
|
1240
1277
|
:build => 'Moneta::Adapters::DataMapper.new(:setup => "mysql://root:@localhost/moneta", :table => "adapter_datamapper")',
|
@@ -1390,6 +1427,14 @@ end}
|
|
1390
1427
|
:build => 'Moneta::Adapters::SDBM.new(:file => File.join(make_tempdir, "adapter_sdbm"))',
|
1391
1428
|
:specs => ADAPTER_SPECS.without_multiprocess.without_large
|
1392
1429
|
},
|
1430
|
+
'adapter_lmdb' => {
|
1431
|
+
:build => 'Moneta::Adapters::LMDB.new(:dir => File.join(make_tempdir, "adapter_lmdb"))',
|
1432
|
+
:specs => ADAPTER_SPECS.without_concurrent
|
1433
|
+
},
|
1434
|
+
'adapter_lmdb_with_db' => {
|
1435
|
+
:build => 'Moneta::Adapters::LMDB.new(:dir => File.join(make_tempdir, "adapter_lmdb"), :db => "adapter_lmdb_with_db")',
|
1436
|
+
:specs => ADAPTER_SPECS.without_concurrent
|
1437
|
+
},
|
1393
1438
|
'adapter_leveldb' => {
|
1394
1439
|
:build => 'Moneta::Adapters::LevelDB.new(:dir => File.join(make_tempdir, "adapter_leveldb"))',
|
1395
1440
|
:specs => ADAPTER_SPECS.without_multiprocess
|
@@ -1651,22 +1696,24 @@ end}
|
|
1651
1696
|
SPECS = {}
|
1652
1697
|
|
1653
1698
|
KEYS = {
|
1654
|
-
'nil' => [
|
1699
|
+
'nil' => ['nil', 0],
|
1655
1700
|
'integer' => [-10, 42],
|
1656
1701
|
'number' => [0.5, -0.3, 1<<127, 99],
|
1657
1702
|
'boolean' => [true, false],
|
1658
|
-
'string' => %w(strkey1 strkey2
|
1659
|
-
'
|
1703
|
+
'string' => %w(strkey1 strkey2).map(&:inspect),
|
1704
|
+
'path' => %w(bar/foo/baz foo/bar).map(&:inspect),
|
1705
|
+
'binary' => ["\xC3\xBCber", "\xAA\xBB\xCC"].map(&:inspect),
|
1660
1706
|
'object' => ['Value.new(:objkey1)', 'Value.new(:objkey2)'],
|
1661
1707
|
'hash' => [{'hashkey1' => 'hashkey2'}, {'hashkey3' => 'hashkey4'}].map(&:inspect)
|
1662
1708
|
}
|
1663
1709
|
|
1664
1710
|
VALUES = {
|
1665
|
-
'nil' => [
|
1711
|
+
'nil' => ["''", 'nil', 0, false],
|
1666
1712
|
'integer' => [41, -12],
|
1667
1713
|
'number' => [123.456, -98.7, 1<<128, 33],
|
1668
1714
|
'boolean' => [true, false],
|
1669
1715
|
'string' => %w(strval1 strval2).map(&:inspect),
|
1716
|
+
'binary' => ["\xC3\xBCber", "\xAA\xBB\xCC"].map(&:inspect),
|
1670
1717
|
'hash' => [{'hashval1' => ['array1', 1]}, {'hashval3' => ['array2', {'hashval4' => 42}]}].map(&:inspect),
|
1671
1718
|
'object' => ['Value.new(:objval1)', 'Value.new(:objval2)'],
|
1672
1719
|
}
|