moneta 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.rspec +4 -0
- data/.travis.yml +83 -32
- data/.yardopts +6 -1
- data/CHANGES +30 -0
- data/CONTRIBUTORS +4 -0
- data/Gemfile +28 -36
- data/LICENSE +1 -1
- data/README.md +136 -67
- data/SPEC.md +70 -0
- data/feature_matrix.yaml +235 -0
- data/lib/active_support/cache/moneta_store.rb +102 -6
- data/lib/moneta.rb +9 -2
- data/lib/moneta/adapters/activerecord.rb +258 -98
- data/lib/moneta/adapters/activesupportcache.rb +133 -0
- data/lib/moneta/adapters/cassandra.rb +290 -44
- data/lib/moneta/adapters/client.rb +11 -2
- data/lib/moneta/adapters/couch.rb +179 -25
- data/lib/moneta/adapters/datamapper.rb +1 -0
- data/lib/moneta/adapters/daybreak.rb +21 -4
- data/lib/moneta/adapters/dbm.rb +7 -7
- data/lib/moneta/adapters/file.rb +11 -1
- data/lib/moneta/adapters/gdbm.rb +7 -7
- data/lib/moneta/adapters/kyotocabinet.rb +66 -1
- data/lib/moneta/adapters/leveldb.rb +27 -1
- data/lib/moneta/adapters/lmdb.rb +29 -1
- data/lib/moneta/adapters/lruhash.rb +30 -0
- data/lib/moneta/adapters/memcached/dalli.rb +50 -5
- data/lib/moneta/adapters/memcached/native.rb +11 -4
- data/lib/moneta/adapters/memory.rb +2 -0
- data/lib/moneta/adapters/mongo/base.rb +32 -7
- data/lib/moneta/adapters/mongo/moped.rb +59 -2
- data/lib/moneta/adapters/mongo/official.rb +40 -0
- data/lib/moneta/adapters/pstore.rb +56 -8
- data/lib/moneta/adapters/redis.rb +79 -19
- data/lib/moneta/adapters/sdbm.rb +7 -7
- data/lib/moneta/adapters/sequel.rb +440 -39
- data/lib/moneta/adapters/sqlite.rb +74 -10
- data/lib/moneta/adapters/tdb.rb +16 -1
- data/lib/moneta/adapters/tokyocabinet.rb +7 -1
- data/lib/moneta/adapters/tokyotyrant.rb +22 -0
- data/lib/moneta/cache.rb +11 -1
- data/lib/moneta/expires.rb +110 -8
- data/lib/moneta/lock.rb +21 -2
- data/lib/moneta/mixins.rb +279 -3
- data/lib/moneta/pool.rb +15 -6
- data/lib/moneta/proxy.rb +46 -2
- data/lib/moneta/server.rb +5 -1
- data/lib/moneta/shared.rb +27 -11
- data/lib/moneta/stack.rb +1 -1
- data/lib/moneta/synchronize.rb +2 -8
- data/lib/moneta/transformer.rb +152 -2
- data/lib/moneta/transformer/config.rb +2 -0
- data/lib/moneta/transformer/helper.rb +2 -2
- data/lib/moneta/version.rb +1 -1
- data/lib/moneta/weak_each_key.rb +74 -0
- data/lib/moneta/wrapper.rb +25 -0
- data/moneta.gemspec +2 -2
- data/script/benchmarks +174 -62
- data/script/parallel-tests +58 -83
- data/script/start-hbase +46 -0
- data/script/start-services +9 -2
- data/script/update-feature-matrix +148 -0
- data/spec/active_support/cache_moneta_store_spec.rb +132 -109
- data/spec/features/concurrent_create.rb +21 -0
- data/spec/features/concurrent_increment.rb +32 -0
- data/spec/features/create.rb +25 -0
- data/spec/features/create_expires.rb +19 -0
- data/spec/features/default_expires.rb +15 -0
- data/spec/features/each_key.rb +119 -0
- data/spec/features/expires.rb +291 -0
- data/spec/features/features.rb +16 -0
- data/spec/features/increment.rb +98 -0
- data/spec/features/marshallable_key.rb +43 -0
- data/spec/features/marshallable_value.rb +7 -0
- data/spec/features/multiprocess.rb +8 -0
- data/spec/features/not_create.rb +7 -0
- data/spec/features/not_each_key.rb +7 -0
- data/spec/features/not_increment.rb +13 -0
- data/spec/features/not_persist.rb +9 -0
- data/spec/features/null.rb +66 -0
- data/spec/features/persist.rb +14 -0
- data/spec/features/returndifferent.rb +9 -0
- data/spec/features/returnsame.rb +9 -0
- data/spec/features/store.rb +261 -0
- data/spec/features/store_large.rb +13 -0
- data/spec/features/transform_value.rb +44 -0
- data/spec/features/transform_value_expires.rb +41 -0
- data/spec/helper.rb +391 -74
- data/spec/moneta/adapters/activerecord/adapter_activerecord_existing_connection_spec.rb +59 -0
- data/spec/moneta/adapters/activerecord/adapter_activerecord_spec.rb +118 -0
- data/spec/moneta/adapters/activerecord/standard_activerecord_spec.rb +18 -0
- data/spec/moneta/adapters/activerecord/standard_activerecord_with_expires_spec.rb +24 -0
- data/spec/moneta/adapters/activesupportcache/adapter_activesupportcache_spec.rb +51 -0
- data/spec/moneta/adapters/activesupportcache/adapter_activesupportcache_with_default_expires_spec.rb +51 -0
- data/spec/moneta/adapters/cassandra/adapter_cassandra_spec.rb +17 -0
- data/spec/moneta/adapters/cassandra/adapter_cassandra_with_default_expires_spec.rb +18 -0
- data/spec/moneta/adapters/cassandra/helper.rb +18 -0
- data/spec/moneta/adapters/cassandra/standard_cassandra_spec.rb +18 -0
- data/spec/moneta/adapters/client/adapter_client_spec.rb +11 -0
- data/spec/moneta/adapters/client/standard_client_tcp_spec.rb +23 -0
- data/spec/moneta/adapters/client/standard_client_unix_spec.rb +12 -0
- data/spec/moneta/adapters/cookie/adapter_cookie_spec.rb +7 -0
- data/spec/moneta/adapters/couch/adapter_couch_spec.rb +7 -0
- data/spec/moneta/adapters/couch/standard_couch_spec.rb +9 -0
- data/spec/moneta/adapters/couch/standard_couch_with_expires_spec.rb +13 -0
- data/spec/moneta/adapters/datamapper/adapter_datamapper_spec.rb +43 -0
- data/spec/moneta/adapters/datamapper/standard_datamapper_spec.rb +21 -0
- data/spec/moneta/adapters/datamapper/standard_datamapper_with_expires_spec.rb +26 -0
- data/spec/moneta/adapters/datamapper/standard_datamapper_with_repository_spec.rb +22 -0
- data/spec/moneta/adapters/daybreak/adapter_daybreak_spec.rb +7 -0
- data/spec/moneta/adapters/daybreak/standard_daybreak_spec.rb +7 -0
- data/spec/moneta/adapters/daybreak/standard_daybreak_with_expires_spec.rb +11 -0
- data/spec/moneta/adapters/dbm/adapter_dbm_spec.rb +7 -0
- data/spec/moneta/adapters/dbm/standard_dbm_spec.rb +7 -0
- data/spec/moneta/adapters/dbm/standard_dbm_with_expires_spec.rb +12 -0
- data/spec/moneta/adapters/file/adapter_file_spec.rb +7 -0
- data/spec/moneta/adapters/file/standard_file_spec.rb +7 -0
- data/spec/moneta/adapters/file/standard_file_with_expires_spec.rb +11 -0
- data/spec/moneta/adapters/fog/adapter_fog_spec.rb +16 -0
- data/spec/moneta/adapters/fog/standard_fog_spec.rb +15 -0
- data/spec/moneta/adapters/fog/standard_fog_with_expires_spec.rb +20 -0
- data/spec/moneta/adapters/gdbm/adapter_gdbm_spec.rb +7 -0
- data/spec/moneta/adapters/gdbm/standard_gdbm_spec.rb +7 -0
- data/spec/moneta/adapters/gdbm/standard_gdbm_with_expires_spec.rb +11 -0
- data/spec/moneta/adapters/hashfile/standard_hashfile_spec.rb +7 -0
- data/spec/moneta/adapters/hashfile/standard_hashfile_with_expires_spec.rb +12 -0
- data/spec/moneta/adapters/hbase/adapter_hbase_spec.rb +7 -0
- data/spec/moneta/adapters/hbase/standard_hbase_spec.rb +4 -0
- data/spec/moneta/adapters/hbase/standard_hbase_with_expires_spec.rb +8 -0
- data/spec/moneta/adapters/kyotocabinet/adapter_kyotocabinet_spec.rb +7 -0
- data/spec/moneta/adapters/kyotocabinet/standard_kyotocabinet_spec.rb +7 -0
- data/spec/moneta/adapters/kyotocabinet/standard_kyotocabinet_with_expires_spec.rb +14 -0
- data/spec/moneta/adapters/leveldb/adapter_leveldb_spec.rb +7 -0
- data/spec/moneta/adapters/leveldb/standard_leveldb_spec.rb +7 -0
- data/spec/moneta/adapters/leveldb/standard_leveldb_with_expires_spec.rb +11 -0
- data/spec/moneta/adapters/lmdb/adapter_lmdb_spec.rb +7 -0
- data/spec/moneta/adapters/lmdb/adapter_lmdb_with_db_spec.rb +7 -0
- data/spec/moneta/adapters/lmdb/standard_lmdb_spec.rb +7 -0
- data/spec/moneta/adapters/lmdb/standard_lmdb_with_expires_spec.rb +11 -0
- data/spec/moneta/adapters/localmemcache/adapter_localmemcache_spec.rb +7 -0
- data/spec/moneta/adapters/localmemcache/standard_localmemcache_spec.rb +7 -0
- data/spec/moneta/adapters/localmemcache/standard_localmemcache_with_expires_spec.rb +11 -0
- data/spec/moneta/{adapter_lruhash_spec.rb → adapters/lruhash/adapter_lruhash_spec.rb} +3 -25
- data/spec/moneta/adapters/lruhash/standard_lruhash_spec.rb +4 -0
- data/spec/moneta/adapters/lruhash/standard_lruhash_with_expires_spec.rb +8 -0
- data/spec/moneta/adapters/memcached/adapter_memcached_spec.rb +13 -0
- data/spec/moneta/adapters/memcached/dalli/adapter_memcached_dalli_spec.rb +15 -0
- data/spec/moneta/adapters/memcached/dalli/adapter_memcached_dalli_with_default_expires_spec.rb +15 -0
- data/spec/moneta/adapters/memcached/dalli/standard_memcached_dalli_spec.rb +11 -0
- data/spec/moneta/adapters/memcached/helper.rb +20 -0
- data/spec/moneta/adapters/memcached/native/adapter_memcached_native_spec.rb +15 -0
- data/spec/moneta/adapters/memcached/native/adapter_memcached_native_with_default_expires_spec.rb +15 -0
- data/spec/moneta/adapters/memcached/native/standard_memcached_native_spec.rb +11 -0
- data/spec/moneta/adapters/memcached/standard_memcached_spec.rb +17 -0
- data/spec/moneta/adapters/memory/adapter_memory_spec.rb +7 -0
- data/spec/moneta/adapters/memory/standard_memory_spec.rb +4 -0
- data/spec/moneta/adapters/memory/standard_memory_with_compress_spec.rb +9 -0
- data/spec/moneta/adapters/memory/standard_memory_with_expires_spec.rb +8 -0
- data/spec/moneta/adapters/memory/standard_memory_with_json_key_serializer_spec.rb +4 -0
- data/spec/moneta/adapters/memory/standard_memory_with_json_serializer_spec.rb +9 -0
- data/spec/moneta/adapters/memory/standard_memory_with_json_value_serializer_spec.rb +9 -0
- data/spec/moneta/adapters/memory/standard_memory_with_prefix_spec.rb +4 -0
- data/spec/moneta/adapters/memory/standard_memory_with_snappy_compress_spec.rb +9 -0
- data/spec/moneta/adapters/mongo/adapter_mongo_moped_spec.rb +25 -0
- data/spec/moneta/adapters/mongo/adapter_mongo_moped_with_default_expires_spec.rb +12 -0
- data/spec/moneta/adapters/mongo/adapter_mongo_official_spec.rb +25 -0
- data/spec/moneta/adapters/mongo/adapter_mongo_official_with_default_expires_spec.rb +12 -0
- data/spec/moneta/adapters/mongo/adapter_mongo_spec.rb +11 -0
- data/spec/moneta/adapters/mongo/adapter_mongo_with_default_expires_spec.rb +12 -0
- data/spec/moneta/adapters/mongo/standard_mongo_moped_spec.rb +7 -0
- data/spec/moneta/adapters/mongo/standard_mongo_official_spec.rb +7 -0
- data/spec/moneta/adapters/mongo/standard_mongo_spec.rb +7 -0
- data/spec/moneta/adapters/null/null_adapter_spec.rb +7 -0
- data/spec/moneta/adapters/null/standard_null_spec.rb +4 -0
- data/spec/moneta/adapters/pstore/adapter_pstore_spec.rb +7 -0
- data/spec/moneta/adapters/pstore/standard_pstore_spec.rb +9 -0
- data/spec/moneta/adapters/pstore/standard_pstore_with_expires_spec.rb +13 -0
- data/spec/moneta/adapters/redis/adapter_redis_spec.rb +10 -0
- data/spec/moneta/adapters/redis/adapter_redis_with_default_expires_spec.rb +10 -0
- data/spec/moneta/adapters/redis/standard_redis_spec.rb +7 -0
- data/spec/moneta/adapters/restclient/adapter_restclient_spec.rb +11 -0
- data/spec/moneta/adapters/restclient/standard_restclient_spec.rb +10 -0
- data/spec/moneta/adapters/riak/adapter_riak_spec.rb +14 -0
- data/spec/moneta/adapters/riak/standard_riak_spec.rb +10 -0
- data/spec/moneta/adapters/riak/standard_riak_with_expires_spec.rb +10 -0
- data/spec/moneta/adapters/sdbm/adapter_sdbm_spec.rb +7 -0
- data/spec/moneta/adapters/sdbm/standard_sdbm_spec.rb +7 -0
- data/spec/moneta/adapters/sdbm/standard_sdbm_with_expires_spec.rb +11 -0
- data/spec/moneta/adapters/sequel/adapter_sequel_spec.rb +181 -0
- data/spec/moneta/adapters/sequel/standard_sequel_spec.rb +14 -0
- data/spec/moneta/adapters/sequel/standard_sequel_with_expires_spec.rb +19 -0
- data/spec/moneta/adapters/sqlite/adapter_sqlite_spec.rb +7 -0
- data/spec/moneta/adapters/sqlite/standard_sqlite_spec.rb +7 -0
- data/spec/moneta/adapters/sqlite/standard_sqlite_with_expires_spec.rb +15 -0
- data/spec/moneta/adapters/tdb/adapter_tdb_spec.rb +7 -0
- data/spec/moneta/adapters/tdb/standard_tdb_spec.rb +7 -0
- data/spec/moneta/adapters/tdb/standard_tdb_with_expires_spec.rb +11 -0
- data/spec/moneta/adapters/tokyocabinet/adapter_tokyocabinet_bdb_spec.rb +7 -0
- data/spec/moneta/adapters/tokyocabinet/adapter_tokyocabinet_hdb_spec.rb +7 -0
- data/spec/moneta/adapters/tokyocabinet/standard_tokyocabinet_spec.rb +7 -0
- data/spec/moneta/adapters/tokyocabinet/standard_tokyocabinet_with_expires_spec.rb +11 -0
- data/spec/moneta/adapters/tokyotyrant/adapter_tokyotyrant_spec.rb +7 -0
- data/spec/moneta/adapters/tokyotyrant/standard_tokyotyrant_spec.rb +4 -0
- data/spec/moneta/adapters/tokyotyrant/standard_tokyotyrant_with_expires_spec.rb +8 -0
- data/spec/moneta/adapters/yaml/adapter_yaml_spec.rb +7 -0
- data/spec/moneta/adapters/yaml/standard_yaml_spec.rb +9 -0
- data/spec/moneta/adapters/yaml/standard_yaml_with_expires_spec.rb +13 -0
- data/spec/moneta/builder_spec.rb +0 -1
- data/spec/moneta/mutex_spec.rb +6 -23
- data/spec/moneta/proxies/cache/cache_file_memory_spec.rb +24 -0
- data/spec/moneta/proxies/cache/cache_memory_null_spec.rb +12 -0
- data/spec/moneta/proxies/expires/expires_file_spec.rb +28 -0
- data/spec/moneta/proxies/expires/expires_memory_spec.rb +15 -0
- data/spec/moneta/proxies/expires/expires_memory_with_default_expires_spec.rb +16 -0
- data/spec/moneta/proxies/lock/lock_spec.rb +10 -0
- data/spec/moneta/{optionmerger_spec.rb → proxies/optionmerger/optionmerger_spec.rb} +2 -18
- data/spec/moneta/proxies/pool/pool_spec.rb +12 -0
- data/spec/moneta/proxies/proxy/proxy_expires_memory_spec.rb +16 -0
- data/spec/moneta/proxies/proxy/proxy_redis_spec.rb +13 -0
- data/spec/moneta/proxies/shared/shared_tcp_spec.rb +49 -0
- data/spec/moneta/proxies/shared/shared_unix_spec.rb +48 -0
- data/spec/moneta/proxies/transformer/transformer_bencode_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_bert_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_bson_spec.rb +23 -0
- data/spec/moneta/proxies/transformer/transformer_bzip2_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_json_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_key_inspect_spec.rb +17 -0
- data/spec/moneta/proxies/transformer/transformer_key_marshal_spec.rb +17 -0
- data/spec/moneta/proxies/transformer/transformer_key_to_s_spec.rb +17 -0
- data/spec/moneta/proxies/transformer/transformer_key_yaml_spec.rb +17 -0
- data/spec/moneta/proxies/transformer/transformer_lz4_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_lzma_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_lzo_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_base64_spec.rb +20 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_city128_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_city32_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_city64_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_escape_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_hex_spec.rb +20 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_hmac_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_md5_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_md5_spread_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_prefix_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_qp_spec.rb +20 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_rmd160_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_sha1_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_sha256_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_sha384_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_sha512_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_truncate_spec.rb +15 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_urlsafe_base64_spec.rb +20 -0
- data/spec/moneta/proxies/transformer/transformer_marshal_uuencode_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_msgpack_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_ox_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_php_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_quicklz_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_snappy_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_tnet_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_value_marshal_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_value_yaml_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_yaml_spec.rb +19 -0
- data/spec/moneta/proxies/transformer/transformer_zlib_spec.rb +19 -0
- data/spec/moneta/proxies/weak_create/weak_create_spec.rb +21 -0
- data/spec/moneta/proxies/weak_each_key/weak_each_key_spec.rb +24 -0
- data/spec/moneta/proxies/weak_increment/weak_increment_spec.rb +21 -0
- data/spec/moneta/semaphore_spec.rb +6 -23
- data/spec/moneta/stack_file_memory_spec.rb +5 -29
- data/spec/moneta/stack_memory_file_spec.rb +5 -31
- data/spec/quality_spec.rb +1 -1
- data/{spec → test}/action_dispatch/fixtures/session_autoload_test/foo.rb +0 -0
- data/{spec/action_dispatch/session_moneta_store_spec.rb → test/action_dispatch/session_moneta_store_test.rb} +13 -5
- metadata +415 -355
- data/script/generate-specs +0 -2696
- data/spec/moneta/adapter_activerecord_exisiting_connection_spec.rb +0 -36
- data/spec/moneta/adapter_activerecord_spec.rb +0 -65
- data/spec/moneta/adapter_cassandra_spec.rb +0 -33
- data/spec/moneta/adapter_cassandra_with_default_expires_spec.rb +0 -34
- data/spec/moneta/adapter_client_spec.rb +0 -35
- data/spec/moneta/adapter_cookie_spec.rb +0 -30
- data/spec/moneta/adapter_couch_spec.rb +0 -36
- data/spec/moneta/adapter_datamapper_spec.rb +0 -64
- data/spec/moneta/adapter_daybreak_spec.rb +0 -31
- data/spec/moneta/adapter_dbm_spec.rb +0 -31
- data/spec/moneta/adapter_file_spec.rb +0 -34
- data/spec/moneta/adapter_fog_spec.rb +0 -37
- data/spec/moneta/adapter_gdbm_spec.rb +0 -31
- data/spec/moneta/adapter_hbase_spec.rb +0 -33
- data/spec/moneta/adapter_kyotocabinet_spec.rb +0 -31
- data/spec/moneta/adapter_leveldb_spec.rb +0 -31
- data/spec/moneta/adapter_lmdb_spec.rb +0 -32
- data/spec/moneta/adapter_lmdb_with_db_spec.rb +0 -32
- data/spec/moneta/adapter_localmemcache_spec.rb +0 -32
- data/spec/moneta/adapter_memcached_dalli_spec.rb +0 -36
- data/spec/moneta/adapter_memcached_dalli_with_default_expires_spec.rb +0 -37
- data/spec/moneta/adapter_memcached_native_spec.rb +0 -36
- data/spec/moneta/adapter_memcached_native_with_default_expires_spec.rb +0 -37
- data/spec/moneta/adapter_memcached_spec.rb +0 -36
- data/spec/moneta/adapter_memcached_with_default_expires_spec.rb +0 -37
- data/spec/moneta/adapter_memory_spec.rb +0 -184
- data/spec/moneta/adapter_mongo_moped_spec.rb +0 -64
- data/spec/moneta/adapter_mongo_moped_with_default_expires_spec.rb +0 -53
- data/spec/moneta/adapter_mongo_official_spec.rb +0 -64
- data/spec/moneta/adapter_mongo_official_with_default_expires_spec.rb +0 -53
- data/spec/moneta/adapter_mongo_spec.rb +0 -51
- data/spec/moneta/adapter_mongo_with_default_expires_spec.rb +0 -53
- data/spec/moneta/adapter_pstore_spec.rb +0 -250
- data/spec/moneta/adapter_redis_spec.rb +0 -36
- data/spec/moneta/adapter_redis_with_default_expires_spec.rb +0 -37
- data/spec/moneta/adapter_restclient_spec.rb +0 -33
- data/spec/moneta/adapter_riak_spec.rb +0 -36
- data/spec/moneta/adapter_sdbm_spec.rb +0 -30
- data/spec/moneta/adapter_sequel_spec.rb +0 -34
- data/spec/moneta/adapter_sqlite_spec.rb +0 -32
- data/spec/moneta/adapter_tdb_spec.rb +0 -31
- data/spec/moneta/adapter_tokyocabinet_bdb_spec.rb +0 -31
- data/spec/moneta/adapter_tokyocabinet_hdb_spec.rb +0 -31
- data/spec/moneta/adapter_tokyotyrant_spec.rb +0 -34
- data/spec/moneta/adapter_yaml_spec.rb +0 -57
- data/spec/moneta/cache_file_memory_spec.rb +0 -50
- data/spec/moneta/cache_memory_null_spec.rb +0 -35
- data/spec/moneta/expires_file_spec.rb +0 -78
- data/spec/moneta/expires_memory_spec.rb +0 -189
- data/spec/moneta/expires_memory_with_default_expires_spec.rb +0 -190
- data/spec/moneta/lock_spec.rb +0 -187
- data/spec/moneta/null_adapter_spec.rb +0 -86
- data/spec/moneta/pool_spec.rb +0 -38
- data/spec/moneta/proxy_expires_memory_spec.rb +0 -191
- data/spec/moneta/proxy_redis_spec.rb +0 -40
- data/spec/moneta/shared_tcp_spec.rb +0 -46
- data/spec/moneta/shared_unix_spec.rb +0 -46
- data/spec/moneta/standard_activerecord_spec.rb +0 -253
- data/spec/moneta/standard_activerecord_with_expires_spec.rb +0 -255
- data/spec/moneta/standard_cassandra_spec.rb +0 -252
- data/spec/moneta/standard_client_tcp_spec.rb +0 -269
- data/spec/moneta/standard_client_unix_spec.rb +0 -254
- data/spec/moneta/standard_couch_spec.rb +0 -252
- data/spec/moneta/standard_couch_with_expires_spec.rb +0 -254
- data/spec/moneta/standard_datamapper_spec.rb +0 -254
- data/spec/moneta/standard_datamapper_with_expires_spec.rb +0 -256
- data/spec/moneta/standard_datamapper_with_repository_spec.rb +0 -254
- data/spec/moneta/standard_daybreak_spec.rb +0 -250
- data/spec/moneta/standard_daybreak_with_expires_spec.rb +0 -252
- data/spec/moneta/standard_dbm_spec.rb +0 -250
- data/spec/moneta/standard_dbm_with_expires_spec.rb +0 -252
- data/spec/moneta/standard_file_spec.rb +0 -253
- data/spec/moneta/standard_file_with_expires_spec.rb +0 -255
- data/spec/moneta/standard_fog_spec.rb +0 -256
- data/spec/moneta/standard_fog_with_expires_spec.rb +0 -258
- data/spec/moneta/standard_gdbm_spec.rb +0 -250
- data/spec/moneta/standard_gdbm_with_expires_spec.rb +0 -252
- data/spec/moneta/standard_hashfile_spec.rb +0 -253
- data/spec/moneta/standard_hashfile_with_expires_spec.rb +0 -255
- data/spec/moneta/standard_hbase_spec.rb +0 -252
- data/spec/moneta/standard_hbase_with_expires_spec.rb +0 -255
- data/spec/moneta/standard_kyotocabinet_spec.rb +0 -250
- data/spec/moneta/standard_kyotocabinet_with_expires_spec.rb +0 -252
- data/spec/moneta/standard_leveldb_spec.rb +0 -250
- data/spec/moneta/standard_leveldb_with_expires_spec.rb +0 -252
- data/spec/moneta/standard_lmdb_spec.rb +0 -251
- data/spec/moneta/standard_lmdb_with_expires_spec.rb +0 -253
- data/spec/moneta/standard_localmemcache_spec.rb +0 -251
- data/spec/moneta/standard_localmemcache_with_expires_spec.rb +0 -252
- data/spec/moneta/standard_lruhash_spec.rb +0 -187
- data/spec/moneta/standard_lruhash_with_expires_spec.rb +0 -189
- data/spec/moneta/standard_memcached_dalli_spec.rb +0 -255
- data/spec/moneta/standard_memcached_native_spec.rb +0 -255
- data/spec/moneta/standard_memcached_spec.rb +0 -255
- data/spec/moneta/standard_memory_spec.rb +0 -187
- data/spec/moneta/standard_memory_with_compress_spec.rb +0 -187
- data/spec/moneta/standard_memory_with_expires_spec.rb +0 -189
- data/spec/moneta/standard_memory_with_json_key_serializer_spec.rb +0 -86
- data/spec/moneta/standard_memory_with_json_serializer_spec.rb +0 -49
- data/spec/moneta/standard_memory_with_json_value_serializer_spec.rb +0 -90
- data/spec/moneta/standard_memory_with_prefix_spec.rb +0 -187
- data/spec/moneta/standard_memory_with_snappy_compress_spec.rb +0 -187
- data/spec/moneta/standard_mongo_moped_spec.rb +0 -255
- data/spec/moneta/standard_mongo_official_spec.rb +0 -255
- data/spec/moneta/standard_mongo_spec.rb +0 -255
- data/spec/moneta/standard_null_spec.rb +0 -120
- data/spec/moneta/standard_pstore_spec.rb +0 -253
- data/spec/moneta/standard_pstore_with_expires_spec.rb +0 -255
- data/spec/moneta/standard_redis_spec.rb +0 -255
- data/spec/moneta/standard_restclient_spec.rb +0 -252
- data/spec/moneta/standard_riak_spec.rb +0 -255
- data/spec/moneta/standard_riak_with_expires_spec.rb +0 -256
- data/spec/moneta/standard_sdbm_spec.rb +0 -249
- data/spec/moneta/standard_sdbm_with_expires_spec.rb +0 -251
- data/spec/moneta/standard_sequel_spec.rb +0 -253
- data/spec/moneta/standard_sequel_with_expires_spec.rb +0 -255
- data/spec/moneta/standard_sqlite_spec.rb +0 -251
- data/spec/moneta/standard_sqlite_with_expires_spec.rb +0 -253
- data/spec/moneta/standard_tdb_spec.rb +0 -250
- data/spec/moneta/standard_tdb_with_expires_spec.rb +0 -252
- data/spec/moneta/standard_tokyocabinet_spec.rb +0 -250
- data/spec/moneta/standard_tokyocabinet_with_expires_spec.rb +0 -252
- data/spec/moneta/standard_tokyotyrant_spec.rb +0 -253
- data/spec/moneta/standard_tokyotyrant_with_expires_spec.rb +0 -255
- data/spec/moneta/standard_yaml_spec.rb +0 -250
- data/spec/moneta/standard_yaml_with_expires_spec.rb +0 -252
- data/spec/moneta/transformer_bencode_spec.rb +0 -55
- data/spec/moneta/transformer_bert_spec.rb +0 -55
- data/spec/moneta/transformer_bson_spec.rb +0 -60
- data/spec/moneta/transformer_bzip2_spec.rb +0 -55
- data/spec/moneta/transformer_json_spec.rb +0 -55
- data/spec/moneta/transformer_key_inspect_spec.rb +0 -91
- data/spec/moneta/transformer_key_marshal_spec.rb +0 -191
- data/spec/moneta/transformer_key_to_s_spec.rb +0 -91
- data/spec/moneta/transformer_key_yaml_spec.rb +0 -191
- data/spec/moneta/transformer_lz4_spec.rb +0 -55
- data/spec/moneta/transformer_lzma_spec.rb +0 -55
- data/spec/moneta/transformer_lzo_spec.rb +0 -55
- data/spec/moneta/transformer_marshal_base64_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_city128_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_city32_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_city64_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_escape_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_hex_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_hmac_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_md5_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_md5_spread_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_prefix_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_qp_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_rmd160_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_sha1_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_sha256_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_sha384_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_sha512_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_spec.rb +0 -191
- data/spec/moneta/transformer_marshal_truncate_spec.rb +0 -194
- data/spec/moneta/transformer_marshal_uuencode_spec.rb +0 -194
- data/spec/moneta/transformer_msgpack_spec.rb +0 -55
- data/spec/moneta/transformer_ox_spec.rb +0 -191
- data/spec/moneta/transformer_php_spec.rb +0 -55
- data/spec/moneta/transformer_quicklz_spec.rb +0 -55
- data/spec/moneta/transformer_snappy_spec.rb +0 -55
- data/spec/moneta/transformer_tnet_spec.rb +0 -55
- data/spec/moneta/transformer_value_marshal_spec.rb +0 -191
- data/spec/moneta/transformer_value_yaml_spec.rb +0 -191
- data/spec/moneta/transformer_yaml_spec.rb +0 -191
- data/spec/moneta/transformer_zlib_spec.rb +0 -55
- data/spec/moneta/weak_create_spec.rb +0 -41
- data/spec/moneta/weak_increment_spec.rb +0 -41
- data/spec/monetaspecs.rb +0 -51267
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 238904687ead475c2961fdd367d90c57fd54598e9a802d81df557058fe71019a
|
4
|
+
data.tar.gz: 422fc9af8f65e1fe01cf9cde5fa69d5e4c57a9e3121b92b8796fd81f5f8290b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc36f41ff84caa03b78c7ecd6c2dd69db87f27c96204c8a25429314b860838d79c4aa3087ce71b6074777448a26c9d21ba3bdfa8d747e9a9d841228ecd3231ed
|
7
|
+
data.tar.gz: b1adfbeb3abcfe01867356752a968ded5e188652d55c6bbdc7ef5dca53eb906ff2ff0b82fc32b80a66a8caec75ab38c7dd4968639e600666f4194e239ce547f3
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/.travis.yml
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.
|
4
|
-
- 2.
|
5
|
-
-
|
6
|
-
-
|
7
|
-
-
|
3
|
+
- 2.6
|
4
|
+
- 2.5
|
5
|
+
- 2.4
|
6
|
+
- 2.3
|
7
|
+
- 2.2
|
8
|
+
- jruby-9.2
|
9
|
+
- rbx-3
|
8
10
|
services:
|
9
11
|
- riak
|
10
12
|
- couchdb
|
@@ -12,43 +14,92 @@ services:
|
|
12
14
|
- cassandra
|
13
15
|
- memcached
|
14
16
|
- mongodb
|
17
|
+
- postgresql
|
18
|
+
addons:
|
19
|
+
postgresql: '9.6'
|
15
20
|
before_install:
|
16
|
-
-
|
17
|
-
#- script/install-kyotocabinet
|
18
|
-
- sudo apt-get install -qq libtokyocabinet8 libtokyocabinet-dev liblzo2-dev libtdb-dev libleveldb-dev tokyotyrant
|
21
|
+
- sudo apt-get install -qq libtokyocabinet9 libtokyocabinet-dev libkyotocabinet16 libkyotocabinet-dev liblzo2-dev libtdb-dev libleveldb-dev tokyotyrant
|
19
22
|
- script/start-services
|
20
|
-
cache:
|
23
|
+
cache:
|
24
|
+
bundler: true
|
25
|
+
directories:
|
26
|
+
- downloads
|
21
27
|
before_script:
|
22
28
|
- mysql -e 'create database moneta;'
|
23
|
-
- mysql -e 'create database
|
24
|
-
-
|
29
|
+
- mysql -e 'create database moneta2;'
|
30
|
+
- psql -c 'create database moneta1;' -U postgres
|
31
|
+
- psql -c 'create extension hstore;' -U postgres moneta1
|
32
|
+
- psql -c 'create database moneta2;' -U postgres
|
25
33
|
env:
|
26
34
|
global:
|
27
35
|
- secure: "dtM4n7FP8P0UI9Iq+nsvQ7/yfDqsxhfCO9i8zMxm/f9Kxj5Z/4C7jsXsLA+e\n/7FZ9+ld2QjPSPU0LUiDpj/z81bxyZHwqocQ7Nb0DVvO3JRHpr4/iBQQQHd3\n0jvou3mRbu5mBlUjf1/ALaZA+b+vcnsF9fd86UnkY+ChriylGnM="
|
28
36
|
matrix:
|
29
|
-
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
37
|
+
- SCRIPT='parallel-tests ~unstable --
|
38
|
+
test/action_dispatch/session_moneta_store_test.rb
|
39
|
+
spec/moneta/adapters/activerecord
|
40
|
+
spec/moneta/adapters/localmemcache
|
41
|
+
spec/moneta/adapters/activesupportcache
|
42
|
+
spec/moneta/adapters/lruhash
|
43
|
+
spec/moneta/adapters/gdbm
|
44
|
+
spec/moneta/adapters/null
|
45
|
+
spec/moneta/adapters/datamapper
|
46
|
+
spec/moneta/adapters/pstore
|
47
|
+
spec/moneta/adapters/daybreak
|
48
|
+
spec/moneta/adapters/redis
|
49
|
+
spec/moneta/adapters/dbm
|
50
|
+
spec/moneta/adapters/restclient
|
51
|
+
spec/moneta/adapters/file
|
52
|
+
spec/moneta/adapters/fog
|
53
|
+
spec/moneta/adapters/sdbm
|
54
|
+
spec/moneta/adapters/tokyocabinet
|
55
|
+
spec/moneta/adapters/leveldb
|
56
|
+
spec/moneta/adapters/tokyotyrant
|
57
|
+
spec/moneta/adapters/lmdb
|
58
|
+
spec/moneta/adapters/yaml
|
59
|
+
'
|
60
|
+
- SCRIPT='parallel-tests ~unstable --
|
61
|
+
spec/moneta/adapters/client
|
62
|
+
spec/moneta/adapters/memory
|
63
|
+
spec/moneta/adapters/cookie
|
64
|
+
spec/moneta/adapters/mongo
|
65
|
+
spec/moneta/adapters/tdb
|
66
|
+
spec/moneta/adapters/kyotocabinet
|
67
|
+
'
|
68
|
+
- SCRIPT='parallel-tests ~unstable --
|
69
|
+
spec/moneta/adapters/couch
|
70
|
+
'
|
71
|
+
- SCRIPT='parallel-tests ~unstable --
|
72
|
+
spec/moneta/adapters/memcached/dalli
|
73
|
+
'
|
74
|
+
- SCRIPT='parallel-tests ~unstable --
|
75
|
+
spec/moneta/adapters/memcached/native
|
76
|
+
'
|
77
|
+
- SCRIPT='parallel-tests ~unstable --
|
78
|
+
spec/moneta/adapters/cassandra/adapter_cassandra_spec.rb
|
79
|
+
spec/moneta/adapters/cassandra/standard_cassandra_spec.rb
|
80
|
+
'
|
81
|
+
- SCRIPT='parallel-tests ~unstable --
|
82
|
+
spec/moneta/adapters/cassandra/adapter_cassandra_with_default_expires_spec.rb
|
83
|
+
spec/moneta/adapters/hashfile
|
84
|
+
spec/moneta/adapters/sqlite
|
85
|
+
spec/moneta/adapters/sequel
|
86
|
+
'
|
87
|
+
- SCRIPT='parallel-tests ~unstable --
|
88
|
+
spec/moneta/proxies
|
89
|
+
'
|
90
|
+
- SCRIPT='parallel-tests ~unstable --remainder'
|
91
|
+
- SCRIPT='parallel-tests unstable'
|
92
|
+
- SCRIPT='benchmarks uniform_small'
|
93
|
+
- SCRIPT='benchmarks uniform_medium'
|
94
|
+
- SCRIPT='benchmarks uniform_large'
|
95
|
+
- SCRIPT='benchmarks normal_small'
|
96
|
+
- SCRIPT='benchmarks normal_medium'
|
97
|
+
- SCRIPT='benchmarks normal_large'
|
46
98
|
matrix:
|
47
99
|
allow_failures:
|
48
|
-
- rvm:
|
49
|
-
-
|
50
|
-
|
51
|
-
script: "eval bundle exec ruby script/$SCRIPT"
|
100
|
+
- rvm: rbx-3
|
101
|
+
- env: SCRIPT='parallel-tests unstable'
|
102
|
+
script: "bundle exec script/$SCRIPT"
|
52
103
|
branches:
|
53
104
|
only:
|
54
105
|
- master
|
data/.yardopts
CHANGED
data/CHANGES
CHANGED
@@ -1,3 +1,33 @@
|
|
1
|
+
1.1.0
|
2
|
+
|
3
|
+
* Adapters::ActiveRecord - rewrite to use Arel directly; support for Rails 5
|
4
|
+
* Moneta::Server - close all connections when stopping
|
5
|
+
* Moneta::Shared - recover from socket errors
|
6
|
+
* Transformer - add :urlsafe_base64; use this by default for keys with Couch
|
7
|
+
adapter
|
8
|
+
* Adapters::MongoMoped - recover from failed increment
|
9
|
+
* Moneta::Pool - fix race condition in #pop (#144)
|
10
|
+
* Moneta::Client - raise EOFError if a read fails
|
11
|
+
* Moneta::Expires - use Rational objects to get much more accurate time
|
12
|
+
resolution
|
13
|
+
* Moneta::Lock/Moneta::Pool - allow wrapped methods to call other wrapped
|
14
|
+
methods
|
15
|
+
* Adapters::Sequel - add optimisations for MySQL, PostgreSQL and SQLite
|
16
|
+
* Adapters::Sequel - add Postgres+HStore backend
|
17
|
+
* Add Adapters::ActiveSupportCache
|
18
|
+
* Adapters::Sqlite - add :journal_mode option
|
19
|
+
* Add table creation options to Sequel and ActiveRecord adapters
|
20
|
+
* Adapters::ActiveRecord - support for forking (#159)
|
21
|
+
* Adapters::Cassandra - rewrite to use cassandra-driver gem (#81)
|
22
|
+
* Adapters::Couch - add a LRUHash to cache document revs
|
23
|
+
* Adapters::KyotoCabinet - implement atomic increment
|
24
|
+
* Add :each_key feature and implemented on many adapters; add
|
25
|
+
Moneta::WeakEachKey (#143; see feature matrix)
|
26
|
+
* Add bulk read/write methods to the spec; added default implementation to
|
27
|
+
Defaults and fast versions in many adapters (#116; see feature matrix)
|
28
|
+
* First class support for latest JRuby (#160)
|
29
|
+
* Minimum required MRI version is now 2.2.2 (#135)
|
30
|
+
|
1
31
|
1.0.0
|
2
32
|
|
3
33
|
* Adapters::Sequel - allow usage of Sequel extensions and connection validation
|
data/CONTRIBUTORS
CHANGED
@@ -20,7 +20,11 @@ Jeremy Voorhis <jvoorhis@gmail.com>
|
|
20
20
|
Jon Crosby <jon@joncrosby.me>
|
21
21
|
lakshan <lakshan@web2media.net>
|
22
22
|
Mal McKay <mal.mckay@gmail.com>
|
23
|
+
Marek Skrobacki <skrobul@skrobul.com>
|
24
|
+
Mauro Asprea <mauroasprea@gmail.com>
|
23
25
|
Nathaniel Bibler <git@nathanielbibler.com>
|
26
|
+
Olle Jonsson <olle.jonsson@gmail.com>
|
27
|
+
Patrik Rak <patrik@raxoft.cz>
|
24
28
|
Piotr Murach <pmurach@gmail.com>
|
25
29
|
Potapov Sergey <blake131313@gmail.com>
|
26
30
|
Quin Hoxie <quin@aboutus.org>
|
data/Gemfile
CHANGED
@@ -2,8 +2,11 @@ source 'https://rubygems.org'
|
|
2
2
|
gemspec
|
3
3
|
|
4
4
|
# Testing
|
5
|
-
gem 'rspec', '~>
|
6
|
-
gem 'rspec-retry'
|
5
|
+
gem 'rspec', '~> 3.0'
|
6
|
+
gem 'rspec-retry'
|
7
|
+
gem 'rantly', '~> 1.2.0'
|
8
|
+
gem 'parallel_tests'
|
9
|
+
gem 'timecop'
|
7
10
|
|
8
11
|
# Serializer used by Transformer
|
9
12
|
gem 'tnetstring'
|
@@ -15,11 +18,10 @@ gem 'ox', platforms: :ruby
|
|
15
18
|
gem 'msgpack', platforms: :ruby
|
16
19
|
gem 'msgpack-jruby', platforms: :jruby
|
17
20
|
gem 'bert', platforms: :ruby
|
18
|
-
gem '
|
19
|
-
gem 'nokogiri', '~> 1.6.0'
|
21
|
+
gem 'php-serialize'
|
20
22
|
|
21
23
|
# Compressors used by Transformer
|
22
|
-
gem 'rbzip2'
|
24
|
+
gem 'rbzip2', '~> 0.3.0'
|
23
25
|
gem 'lz4-ruby', platforms: :ruby
|
24
26
|
gem 'ruby-lzma', platforms: :ruby
|
25
27
|
gem 'lzoruby', platforms: :ruby
|
@@ -35,54 +37,44 @@ gem 'daybreak'
|
|
35
37
|
gem 'dm-core'
|
36
38
|
gem 'dm-migrations'
|
37
39
|
gem 'dm-mysql-adapter'
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
else
|
43
|
-
gem 'fog', '>= 1.11.1'
|
44
|
-
gem 'mime-types'
|
45
|
-
end
|
46
|
-
gem 'activerecord', '~> 4.0.0'
|
47
|
-
gem 'redis'
|
40
|
+
gem 'fog-aws', '>= 1.11.1'
|
41
|
+
gem 'mime-types'
|
42
|
+
gem 'activerecord', '~> 5.2'
|
43
|
+
gem 'redis', '~> 4.0.0'
|
48
44
|
gem 'mongo', '~> 2.1.0'
|
49
45
|
gem 'moped', '>= 2.0.0'
|
50
46
|
gem 'sequel'
|
51
47
|
gem 'dalli'
|
52
48
|
gem 'riak-client'
|
53
|
-
gem 'cassandra'
|
54
|
-
if RUBY_VERSION < '2.0'
|
55
|
-
gem 'json', '~> 1.0'
|
56
|
-
end
|
49
|
+
gem 'cassandra-driver'
|
57
50
|
gem 'tokyotyrant'
|
58
51
|
#gem 'ruby-tokyotyrant', platforms: :ruby
|
59
|
-
|
60
|
-
gem 'localmemcache'
|
52
|
+
gem 'hbaserb'
|
53
|
+
gem 'localmemcache', platforms: :ruby
|
61
54
|
gem 'tdb', platforms: :ruby
|
62
55
|
gem 'leveldb-ruby', platforms: :ruby
|
63
56
|
gem 'lmdb', platforms: :mri
|
64
|
-
|
65
|
-
|
66
|
-
end
|
67
|
-
#if RUBY_VERSION < '2.0' && !defined?(JRUBY_VERSION)
|
68
|
-
# FIXME: We have to check manually for jruby
|
69
|
-
# otherwise bundle install --deployment doesn't work
|
70
|
-
# gem 'kyotocabinet-ruby', github: 'minad/kyotocabinet-ruby'
|
71
|
-
#end
|
57
|
+
gem 'tokyocabinet', platforms: :ruby
|
58
|
+
gem 'kyotocabinet-ruby-reanimated', platforms: :ruby
|
72
59
|
gem 'memcached', platforms: :ruby
|
73
60
|
gem 'jruby-memcached', platforms: :jruby
|
74
|
-
gem 'sqlite3', platforms: :ruby
|
61
|
+
gem 'sqlite3', '~> 1.3.6', platforms: :ruby
|
75
62
|
gem 'activerecord-jdbc-adapter', platforms: :jruby
|
76
63
|
gem 'activerecord-jdbcmysql-adapter', platforms: :jruby
|
77
|
-
gem '
|
78
|
-
|
79
|
-
gem '
|
80
|
-
gem '
|
64
|
+
gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
|
65
|
+
gem 'activerecord-jdbcpostgresql-adapter', platforms: :jruby
|
66
|
+
gem 'activerecord-jdbch2-adapter', platforms: :jruby
|
67
|
+
gem 'mysql2', platforms: :ruby
|
68
|
+
gem 'ffi-gdbm', platforms: :jruby
|
69
|
+
gem 'pg', platforms: :ruby
|
81
70
|
|
82
71
|
# Rack integration testing
|
83
72
|
gem 'rack'
|
84
73
|
gem 'rack-cache'
|
85
74
|
|
86
75
|
# Rails integration testing
|
87
|
-
gem 'actionpack', '~>
|
88
|
-
gem 'minitest', '~>
|
76
|
+
gem 'actionpack', '~> 5.0'
|
77
|
+
gem 'minitest', '~> 5.0'
|
78
|
+
|
79
|
+
# Used for generating the feature matrix
|
80
|
+
gem 'kramdown', '~> 1.17.0', group: :doc
|
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2009 -
|
1
|
+
Copyright (c) 2009 - 2019 Daniel Mendler, Yehuda Katz, Alastair Pharo
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# Moneta: A unified interface for key/value stores
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/moneta.
|
4
|
-
[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=min4d&url=https://github.com/minad/moneta&title=Moneta&language=&tags=github&category=software)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/moneta.svg)](http://rubygems.org/gems/moneta) [![Build Status](https://secure.travis-ci.org/moneta-rb/moneta.svg?branch=master)](http://travis-ci.org/moneta-rb/moneta) [![Code Climate](https://codeclimate.com/github/moneta-rb/moneta.svg)](https://codeclimate.com/github/moneta-rb/moneta) [![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=min4d&url=https://github.com/moneta-rb/moneta&title=Moneta&language=&tags=github&category=software)
|
5
4
|
|
6
5
|
Moneta provides a standard interface for interacting with various kinds of key/value stores. Moneta supports the well-known
|
7
6
|
NoSQL and document based stores.
|
@@ -30,7 +29,7 @@ same for template languages.
|
|
30
29
|
* Give people a starting point or example code to start working with their favourite key/value store. Feel free to copy code, please mention Moneta then :)
|
31
30
|
* Create a reusable piece of code, since similar things are solved over and over again ([Rails](http://rubyonrails.org/) brings its own cache stores, and many frameworks do the same...)
|
32
31
|
|
33
|
-
Moneta is tested thoroughly using [Travis-CI](http://travis-ci.org/
|
32
|
+
Moneta is tested thoroughly using [Travis-CI](http://travis-ci.org/moneta-rb/moneta).
|
34
33
|
|
35
34
|
------
|
36
35
|
|
@@ -70,12 +69,12 @@ store.close
|
|
70
69
|
|
71
70
|
## Links
|
72
71
|
|
73
|
-
* Source: <http://github.com/
|
74
|
-
* Bugs: <http://github.com/
|
75
|
-
* Tests and benchmarks: <http://travis-ci.org/
|
72
|
+
* Source: <http://github.com/moneta-rb/moneta>
|
73
|
+
* Bugs: <http://github.com/moneta-rb/moneta/issues>
|
74
|
+
* Tests and benchmarks: <http://travis-ci.org/moneta-rb/moneta>
|
76
75
|
* API documentation:
|
77
76
|
* Latest Gem: <http://rubydoc.info/gems/moneta/frames>
|
78
|
-
* GitHub master: <http://rubydoc.info/github/
|
77
|
+
* GitHub master: <http://rubydoc.info/github/moneta-rb/moneta/master/frames>
|
79
78
|
|
80
79
|
------
|
81
80
|
|
@@ -130,100 +129,104 @@ to upgrade to a real key/value store.
|
|
130
129
|
|
131
130
|
### Backend feature matrix
|
132
131
|
|
133
|
-
__NOTE:__ <a name="backend-matrix"></a>The backend matrix is much more readable on rubydoc.info than on github. [Go there!](http://rubydoc.info/github/
|
132
|
+
__NOTE:__ <a name="backend-matrix"></a>The backend matrix is much more readable on rubydoc.info than on github. [Go there!](http://rubydoc.info/github/moneta-rb/moneta/master/file/README.md#backend-matrix)
|
134
133
|
|
135
134
|
<table>
|
135
|
+
<tr><th>Adapter</th><th>Required gems</th><th style="writing-mode:tb">MRI support<sup>1</sup></th><th style="writing-mode:tb">JRuby support<sup>1</sup></th><th style="writing-mode:tb">Multi-thread safe<sup>2</sup></th><th style="writing-mode:tb">Multi-process safe<sup>3</sup></th><th style="writing-mode:tb">Atomic increment<sup>4</sup></th><th style="writing-mode:tb">Atomic create<sup>5</sup></th><th style="writing-mode:tb">Native expires<sup>6</sup></th><th style="writing-mode:tb">Persistent</th><th style="writing-mode:tb">Key Traversal</th><th style="writing-mode:tb">Bulk read<sup>7</sup></th><th style="writing-mode:tb">Bulk write<sup>8</sup></th><th>Description</th></tr>
|
136
136
|
|
137
|
-
<tr><th
|
137
|
+
<tr><th colspan="2">Persistent stores</th><th colspan="12"></th></tr>
|
138
138
|
|
139
|
-
<tr><
|
139
|
+
<tr><td>Mongo</td><td>mongo or moped</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://www.mongodb.org/">MongoDB</a> database</td></tr>
|
140
140
|
|
141
|
-
<tr><td>
|
141
|
+
<tr><td>MongoOfficial</td><td>mongo</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://www.mongodb.org/">MongoDB</a> database</td></tr>
|
142
142
|
|
143
|
-
<tr><td>
|
143
|
+
<tr><td>MongoMoped</td><td>moped</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://www.mongodb.org/">MongoDB</a> database</td></tr>
|
144
144
|
|
145
|
-
<tr><td>
|
145
|
+
<tr><td>Redis</td><td>redis</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://redis.io/">Redis</a> database</td></tr>
|
146
146
|
|
147
|
-
<tr><td>
|
147
|
+
<tr><td>ActiveRecord</td><td>activerecord</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="https://rubygems.org/gems/activerecord">ActiveRecord</a> ORM</td></tr>
|
148
148
|
|
149
|
-
<tr><td>
|
149
|
+
<tr><td>File</td><td>-</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td>File store</td></tr>
|
150
150
|
|
151
|
-
<tr><td>
|
151
|
+
<tr><td>LMDB</td><td>lmdb</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://symas.com/mdb/">Symas Lightning Memory-Mapped Database (LMDB)</a></td></tr>
|
152
152
|
|
153
|
-
<tr><td>
|
153
|
+
<tr><td>Sequel</td><td>sequel</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://sequel.rubyforge.org/">Sequel</a> ORM</td></tr>
|
154
154
|
|
155
|
-
<tr><td>
|
155
|
+
<tr><td>TokyoTyrant</td><td>tokyotyrant or ruby-tokyotyrant</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td><a href="http://fallabs.com/tokyotyrant/">TokyoTyrant</a> database</td></tr>
|
156
156
|
|
157
|
-
<tr><td>
|
157
|
+
<tr><td>PStore</td><td>-</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓<sup>9</sup></td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://ruby-doc.org/stdlib/libdoc/pstore/rdoc/PStore.html">PStore</a> store</td></tr>
|
158
158
|
|
159
|
-
<tr><td>
|
159
|
+
<tr><td>YAML</td><td>-</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓<sup>9</sup></td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td><a href="http://www.ruby-doc.org/stdlib/libdoc/yaml/rdoc/YAML/Store.html">YAML</a> store</td></tr>
|
160
160
|
|
161
|
-
<tr><td>
|
161
|
+
<tr><td>Sqlite</td><td>sqlite3</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#55F">?</td><td style="text-align:center;background:#5F5">✓<sup>9</sup></td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://sqlite.org/">Sqlite3</a> database</td></tr>
|
162
162
|
|
163
|
-
<tr><td>
|
163
|
+
<tr><td>Daybreak</td><td>daybreak</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td>Incredibly fast pure-ruby key/value store <a href="http://propublica.github.com/daybreak/">Daybreak</a></td></tr>
|
164
164
|
|
165
|
-
<tr><td>
|
165
|
+
<tr><td>DBM</td><td>-</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://www.ruby-doc.org/stdlib/libdoc/dbm/rdoc/DBM.html">Berkeley DB using DBM interface or NDBM (Depends on Ruby environment)</a></td></tr>
|
166
166
|
|
167
|
-
<tr><td>
|
167
|
+
<tr><td>GDBM</td><td>-</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://www.ruby-doc.org/stdlib/libdoc/gdbm/rdoc/GDBM.html">GDBM</a> database</td></tr>
|
168
168
|
|
169
|
-
<tr><td>
|
169
|
+
<tr><td>LevelDB</td><td>leveldb</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://code.google.com/p/leveldb/">LevelDB</a> database</td></tr>
|
170
170
|
|
171
|
-
<tr><td>
|
171
|
+
<tr><td>SDBM</td><td>-</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://www.ruby-doc.org/stdlib/libdoc/sdbm/rdoc/SDBM.html">SDBM</a> database</td></tr>
|
172
172
|
|
173
|
-
<tr><td>
|
173
|
+
<tr><td>TDB</td><td>tdb</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td><a href="http://tdb.samba.org/">TDB</a> database</td></tr>
|
174
174
|
|
175
|
-
<tr><td>
|
175
|
+
<tr><td>KyotoCabinet</td><td>kyotocabinet-ruby or kyotocabinet-ruby-reanimated</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://fallabs.com/kyotocabinet/">KyotoCabinet</a> database</td></tr>
|
176
176
|
|
177
|
-
<tr><td>
|
177
|
+
<tr><td>TokyoCabinet</td><td>tokyocabinet</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td><a href="http://fallabs.com/tokyocabinet/">TokyoCabinet</a> database</td></tr>
|
178
178
|
|
179
|
-
<tr><td>
|
179
|
+
<tr><td>DataMapper</td><td>dm-core, dm-migrations</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td><a href="http://datamapper.org/">DataMapper</a> ORM</td></tr>
|
180
180
|
|
181
|
-
<tr><td>
|
181
|
+
<tr><td>Couch</td><td>faraday, multi_json</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://couchdb.apache.org/">CouchDB</a> database</td></tr>
|
182
182
|
|
183
|
-
<tr><td>
|
183
|
+
<tr><td>HBase</td><td>hbaserb</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#55F">?</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td><a href="http://hbase.apache.org/">HBase</a> database</td></tr>
|
184
184
|
|
185
|
-
<tr><td>
|
185
|
+
<tr><td>Cassandra</td><td>cassandra</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#55F">?</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://cassandra.apache.org/">Cassandra</a> distributed database</td></tr>
|
186
186
|
|
187
|
-
<tr><td>
|
187
|
+
<tr><td>LocalMemCache</td><td>localmemcache</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td><a href="http://localmemcache.rubyforge.org/">LocalMemCache</a> database</td></tr>
|
188
188
|
|
189
|
-
<tr><td>
|
189
|
+
<tr><td>Fog</td><td>fog</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#55F">?</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td><a href="http://fog.io/">Fog</a> cloud store</td></tr>
|
190
190
|
|
191
|
-
<tr><td>
|
191
|
+
<tr><td>Riak</td><td>riak-client</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td><a href="http://docs.basho.com/">Riak</a> database</td></tr>
|
192
192
|
|
193
|
-
<tr><
|
193
|
+
<tr><th colspan="2">Non-persistent stores</th><th colspan="12"></th></tr>
|
194
194
|
|
195
|
-
<tr><
|
195
|
+
<tr><td>MemcachedDalli</td><td>dalli</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗<sup>10</sup></td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td><a href="http://memcached.org/">Memcached</a> database with Dalli library</td></tr>
|
196
196
|
|
197
|
-
<tr><td>
|
197
|
+
<tr><td>Memcached</td><td>dalli or memcached</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#55F">?<sup>11</sup></td><td style="text-align:center;background:#55F">?<sup>11</sup></td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗<sup>10</sup></td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#55F">?<sup>11</sup></td><td style="text-align:center;background:#55F">?<sup>11</sup></td><td><a href="http://memcached.org/">Memcached</a> database</td></tr>
|
198
198
|
|
199
|
-
<tr><td>
|
199
|
+
<tr><td>MemcachedNative</td><td>memcached</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗<sup>10</sup></td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td>Memcached database with native library</td></tr>
|
200
200
|
|
201
|
-
<tr><td>
|
201
|
+
<tr><td>Cookie</td><td>-</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓<sup>12</sup></td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td>Cookie in memory store</td></tr>
|
202
202
|
|
203
|
-
<tr><td>
|
203
|
+
<tr><td>LRUHash</td><td>-</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓<sup>12</sup></td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td>LRU memory store</td></tr>
|
204
204
|
|
205
|
-
<tr><td>
|
205
|
+
<tr><td>Memory</td><td>-</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓<sup>12</sup></td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td>Memory store</td></tr>
|
206
206
|
|
207
|
-
<tr><td>
|
207
|
+
<tr><td>Null</td><td>-</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td>No database</td></tr>
|
208
208
|
|
209
|
-
<tr><
|
209
|
+
<tr><th colspan="2">Network clients</th><th colspan="12"></th></tr>
|
210
210
|
|
211
|
-
<tr><td>Client</td><td>-</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#55F">?<sup>
|
211
|
+
<tr><td>Client</td><td>-</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#55F">?<sup>13</sup></td><td style="text-align:center;background:#55F">?<sup>13</sup></td><td style="text-align:center;background:#55F">?<sup>13</sup></td><td style="text-align:center;background:#55F">?<sup>13</sup></td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td>Moneta client adapter</td></tr>
|
212
212
|
|
213
|
-
<tr><td>RestClient</td><td
|
213
|
+
<tr><td>RestClient</td><td>-</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#5F5">✓</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#55F">?<sup>13</sup></td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td style="text-align:center;background:#F44">✗</td><td>Moneta REST client adapter</td></tr>
|
214
214
|
|
215
215
|
</table>
|
216
216
|
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
217
|
+
1. Indicates that the adapter is expected to work on this platform. Most adapters will at least work on MRI, but some are curently considered unstable, in which case they are not supported on any platform.
|
218
|
+
2. Make adapters thread-safe by using `Moneta::Lock` or by passing the option `threadsafe: true` to `Moneta#new`. There is also `Moneta::Pool` which can be used to share a store between multiple threads if the store is multi-process safe. I recommend to add the option `:threadsafe` to ensure thread-safety since for example under JRuby and Rubinius even the basic datastructures are not thread safe due to the lack of a global interpreter lock (GIL). This differs from MRI where some adapters might appear thread safe already but only due to the GIL.
|
219
|
+
3. Share a Moneta store between multiple processes using `Moneta::Shared` (See below).
|
220
|
+
4. If a store provides atomic increment it can be used with `Moneta::Semaphore`. You can add weak `#increment` support using the `Moneta::WeakIncrement` proxy.
|
221
|
+
5. If a store provides atomic creation it can be used with `Moneta::Mutex`. You can add weak `#create` support using the `Moneta::WeakCreate` proxy.
|
222
|
+
6. Add expiration support by using `Moneta::Expires` or by passing the option `expires: true` to `Moneta#new`.
|
223
|
+
7. This indicates that there is some performance gain when fetching multiple values at once using `#values_at`/`#fetch_values` or `#slice`. For instance, the `MGET` instruction in Redis, or the ability to retrieve several rows in one query in SQL.
|
224
|
+
8. This indicates that there is some performance gain when storing multiple key/value pairs at once using `#merge!`/`#update`.
|
225
|
+
9. Sqlite/YAML/PStore are multiprocess safe, but the performance suffers badly since the whole database file must be locked for writing. Use a key/value server if you want multiprocess concurrency!
|
226
|
+
10. There are some servers which use the memcached protocol but which are persistent (e.g. [MemcacheDB](http://memcachedb.org/), [Kai](http://sourceforge.net/apps/mediawiki/kai), [IronCache](http://dev.iron.io/cache/reference/memcache/), [Roma](https://github.com/roma/roma/tree), [Flare](http://labs.gree.jp/Top/OpenSource/Flare-en.html) and [Kumofs](https://github.com/etolabo/kumofs))
|
227
|
+
11. This feature is only available if the dalli backend is selected
|
228
|
+
12. Store is multi-process safe because it is an in-memory store, values are not shared between multiple processes
|
229
|
+
13. Depends on server
|
227
230
|
|
228
231
|
------
|
229
232
|
|
@@ -242,6 +245,7 @@ add additional features to storage backends:
|
|
242
245
|
* `Moneta::Logger` to log database accesses. Add it in the builder using `use :Logger`.
|
243
246
|
* `Moneta::Shared` to share a store between multiple processes. Add it in the builder using `use(:Shared) {}`.
|
244
247
|
* `Moneta::WeakIncrement` and `Moneta::WeakCreate` to add `#create` and `#increment` support without atomicity (weak) to stores which don't support it.
|
248
|
+
* `Moneta::WeakEachKey` to add key traversal to stores that don't support it, with the important caveat that only those keys previously seen by this proxy will be traversed.
|
245
249
|
|
246
250
|
### Serializers and compressors (`Moneta::Transformer`)
|
247
251
|
|
@@ -270,7 +274,8 @@ Supported value compressors:
|
|
270
274
|
|
271
275
|
Supported encoders:
|
272
276
|
|
273
|
-
* Base64 (`:base64`)
|
277
|
+
* Base64 (RFC 2045; `:base64`)
|
278
|
+
* URL-safe Base64 (RFC 4648; `:urlsafe_base64`)
|
274
279
|
* Url escape (`:escape`)
|
275
280
|
* Hexadecimal (`:hex`)
|
276
281
|
* QP (`:qp`)
|
@@ -288,7 +293,7 @@ Special transformers:
|
|
288
293
|
|
289
294
|
The Moneta API is purposely extremely similar to the Hash API with a few minor additions.
|
290
295
|
Every method takes also a optional option hash. In order so support an identical API across stores,
|
291
|
-
Moneta does not support
|
296
|
+
Moneta does not support partial matches.
|
292
297
|
|
293
298
|
~~~
|
294
299
|
#initialize(options) options differs per-store, and is used to set up the store.
|
@@ -321,6 +326,35 @@ Moneta does not support iteration or partial matches.
|
|
321
326
|
#create(key, value, options = {}) create entry. This is an atomic operation which is not supported by all stores.
|
322
327
|
Returns true if the value was created.
|
323
328
|
|
329
|
+
#values_at(*keys, **options) retrieve multiple keys. Returns an array of equal length to the keys.
|
330
|
+
Each entry in the array is either the value corresponding to the key
|
331
|
+
in the same position, or nil if the key is not available.
|
332
|
+
|
333
|
+
#fetch_values(*keys, **options, &block) retrieve multiple keys. Return is identical to values_at, except that
|
334
|
+
when a block is given it will be called once for each key that is not
|
335
|
+
available, and the return value of the block will be used in place of
|
336
|
+
nil in the array.
|
337
|
+
|
338
|
+
#slice(*keys, **options) retrieve multiple keys. Returns an enumerable of key-value pairs,
|
339
|
+
one for each of the supplied keys that is present in the store.
|
340
|
+
|
341
|
+
#merge!(pairs, options = {}) set values for multiple keys. "pairs" must be an enumerable of
|
342
|
+
key-value pairs to be stored. Any existing keys will be clobbered.
|
343
|
+
|
344
|
+
#merge!(pairs, options = {}, &block) set values for multiple keys. For each existing key, execute the block
|
345
|
+
passing the key, existing value and new value, and store the return
|
346
|
+
value.
|
347
|
+
|
348
|
+
#update(pairs, options = {}, &block) same as merge!
|
349
|
+
|
350
|
+
#each_key return an enumerable which will yield all keys in the store, one at a
|
351
|
+
time. This method is present if and only if the store supports the
|
352
|
+
:each_key feature.
|
353
|
+
|
354
|
+
#each_key(&block) yield all keys in the store to the block, one at a time. Again, this
|
355
|
+
method is present if and only if the store supports the :each_key
|
356
|
+
feature.
|
357
|
+
|
324
358
|
#clear(options = {}) clear all keys in this store.
|
325
359
|
|
326
360
|
#close close database connection.
|
@@ -422,6 +456,21 @@ cache = Moneta.build do
|
|
422
456
|
end
|
423
457
|
~~~
|
424
458
|
|
459
|
+
### Key traversal
|
460
|
+
|
461
|
+
Where supported by the store's backend, it is possible to traverse the keys in
|
462
|
+
the store using the `#each_key` method. Support for this can be tested by
|
463
|
+
calling `store.supports?(:each_key)`, or checking for the presence of
|
464
|
+
`:each_key` in `store.features`.
|
465
|
+
|
466
|
+
~~~ ruby
|
467
|
+
store.each_key # returns an Enumerable
|
468
|
+
store.each_key do |key|
|
469
|
+
store.load(key) # read operations are supported within the block
|
470
|
+
store[key] = "x" # behaviour of write operations is undefined
|
471
|
+
end
|
472
|
+
~~~
|
473
|
+
|
425
474
|
### Atomic operations
|
426
475
|
|
427
476
|
#### Atomic incrementation and raw access
|
@@ -485,6 +534,24 @@ store.create('key', 'value') # returns true
|
|
485
534
|
store.create('key', 'other value') # returns false
|
486
535
|
~~~
|
487
536
|
|
537
|
+
#### Atomic bulk operations
|
538
|
+
|
539
|
+
All stores support storage and retrieval of multiple keys using
|
540
|
+
`#values_at`/`#fetch_values`/`#slice` and `#merge!`/`#update`. Wherever
|
541
|
+
possible, these operations are performed atomically. When this is not possible,
|
542
|
+
the `#load` and `#store` methods are called once for each key.
|
543
|
+
|
544
|
+
~~~ ruby
|
545
|
+
store.merge!('key1' => 'value1', 'key2' => 'value2') # stores two keys
|
546
|
+
store.values_at('key1', 'key2', 'key3') # returns ['value1', 'value2', nil]
|
547
|
+
store.fetch('key1', 'key3') { |k| k + ' missing' } # returns ['key1', 'key3 missing']
|
548
|
+
store.slice('key1', 'key2', 'key3') # returns enumerable of ['key1', 'value1'], ['key2', 'value2']
|
549
|
+
|
550
|
+
store.merge!('key2' => 'new value2', 'key3' => 'value3') do |key, value, new_value|
|
551
|
+
[value, new_value].join('+')
|
552
|
+
end # stores "value3" and "value2+new value2"
|
553
|
+
~~~
|
554
|
+
|
488
555
|
#### Shared/distributed synchronization primitives
|
489
556
|
|
490
557
|
Moneta provides shared/distributed synchronization primitives which are shared database-wide between
|
@@ -632,6 +699,8 @@ There is a simple middleware which places a Moneta store in the Rack environment
|
|
632
699
|
caching if you add the option `cache: true`. Use it in your `config.ru` like this:
|
633
700
|
|
634
701
|
~~~ ruby
|
702
|
+
require 'rack/moneta_store'
|
703
|
+
|
635
704
|
# Add Rack::MonetaStore somewhere in your rack stack
|
636
705
|
use Rack::MonetaStore, :Memory, cache: true
|
637
706
|
|
@@ -818,9 +887,9 @@ Person.adapter :memory, Moneta.new(:Redis)
|
|
818
887
|
|
819
888
|
## Testing and Benchmarks
|
820
889
|
|
821
|
-
Testing is done using [Travis-CI](http://travis-ci.org/
|
890
|
+
Testing is done using [Travis-CI](http://travis-ci.org/moneta-rb/moneta). Currently we support Ruby >= 1.9.3.
|
822
891
|
|
823
|
-
Benchmarks for each store are done on [Travis-CI](http://travis-ci.org/
|
892
|
+
Benchmarks for each store are done on [Travis-CI](http://travis-ci.org/moneta-rb/moneta) for each build. Take a look there
|
824
893
|
to compare the speed of the different key value stores for different key/value sizes and size distributions.
|
825
894
|
Feel free to add your own configurations! The impact of Moneta should be minimal since it is only a thin layer
|
826
895
|
on top of the different stores.
|
@@ -831,7 +900,7 @@ on top of the different stores.
|
|
831
900
|
## How to contribute?
|
832
901
|
|
833
902
|
Always feel free to open an issue on
|
834
|
-
https://github.com/
|
903
|
+
https://github.com/moneta-rb/moneta/issues if something doesn't work
|
835
904
|
as you expect it to work. Feedback is also very welcome!
|
836
905
|
|
837
906
|
My only request about patches is that you please try
|
@@ -840,12 +909,11 @@ to test them before submitting.
|
|
840
909
|
### Contribute an adapter
|
841
910
|
|
842
911
|
If you want support for another adapter you can at first at it to the list of
|
843
|
-
missing adapters at https://github.com/
|
912
|
+
missing adapters at https://github.com/moneta-rb/moneta/issues/16
|
844
913
|
|
845
|
-
If you choose to implement an adapter please also add tests.
|
846
|
-
|
847
|
-
|
848
|
-
if you need to start additional services.
|
914
|
+
If you choose to implement an adapter please also add tests. Please check also
|
915
|
+
if travis.yml needs changes, for example if you need to start additional
|
916
|
+
services.
|
849
917
|
|
850
918
|
Check if the default settings in Moneta#new are appropriate for your adapter. If
|
851
919
|
not specify a better one.
|
@@ -869,4 +937,5 @@ Don't forget to edit the README.md and the CHANGES.
|
|
869
937
|
|
870
938
|
* [Daniel Mendler](https://github.com/minad)
|
871
939
|
* [Hannes Georg](https://github.com/hannesg)
|
940
|
+
* [Alastair Pharo](https://github.com/asppsa)
|
872
941
|
* Originally by [Yehuda Katz](https://github.com/wycats) and contributors
|