moneta 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +1 -1
  4. data/.travis.yml +10 -4
  5. data/CHANGES +9 -0
  6. data/Gemfile +7 -5
  7. data/README.md +9 -6
  8. data/feature_matrix.yaml +2 -1
  9. data/lib/moneta/adapters/client.rb +56 -19
  10. data/lib/moneta/adapters/couch.rb +5 -0
  11. data/lib/moneta/adapters/mongo/moped.rb +4 -1
  12. data/lib/moneta/builder.rb +2 -2
  13. data/lib/moneta/lock.rb +6 -1
  14. data/lib/moneta/pool.rb +12 -0
  15. data/lib/moneta/proxy.rb +1 -1
  16. data/lib/moneta/server.rb +215 -61
  17. data/lib/moneta/shared.rb +13 -7
  18. data/lib/moneta/transformer.rb +50 -8
  19. data/lib/moneta/transformer/config.rb +59 -40
  20. data/lib/moneta/version.rb +1 -1
  21. data/moneta.gemspec +2 -2
  22. data/script/benchmarks +6 -1
  23. data/script/contributors +1 -2
  24. data/script/start-couchdb +27 -0
  25. data/script/start-hbase +2 -2
  26. data/script/start-services +3 -3
  27. data/spec/features/store.rb +3 -3
  28. data/spec/features/transform_value.rb +27 -21
  29. data/spec/helper.rb +52 -53
  30. data/spec/moneta/adapters/activerecord/standard_activerecord_spec.rb +1 -1
  31. data/spec/moneta/adapters/activerecord/standard_activerecord_with_expires_spec.rb +1 -1
  32. data/spec/moneta/adapters/cassandra/standard_cassandra_spec.rb +1 -1
  33. data/spec/moneta/adapters/client/adapter_client_spec.rb +6 -6
  34. data/spec/moneta/adapters/client/client_helper.rb +24 -0
  35. data/spec/moneta/adapters/client/standard_client_tcp_spec.rb +8 -8
  36. data/spec/moneta/adapters/client/standard_client_unix_spec.rb +23 -7
  37. data/spec/moneta/adapters/couch/adapter_couch_spec.rb +1 -1
  38. data/spec/moneta/adapters/couch/standard_couch_spec.rb +2 -2
  39. data/spec/moneta/adapters/couch/standard_couch_with_expires_spec.rb +2 -2
  40. data/spec/moneta/adapters/daybreak/standard_daybreak_spec.rb +1 -1
  41. data/spec/moneta/adapters/daybreak/standard_daybreak_with_expires_spec.rb +1 -1
  42. data/spec/moneta/adapters/dbm/standard_dbm_spec.rb +1 -1
  43. data/spec/moneta/adapters/dbm/standard_dbm_with_expires_spec.rb +1 -1
  44. data/spec/moneta/adapters/file/standard_file_spec.rb +2 -2
  45. data/spec/moneta/adapters/file/standard_file_with_expires_spec.rb +1 -1
  46. data/spec/moneta/adapters/gdbm/standard_gdbm_spec.rb +1 -1
  47. data/spec/moneta/adapters/gdbm/standard_gdbm_with_expires_spec.rb +1 -1
  48. data/spec/moneta/adapters/kyotocabinet/adapter_kyotocabinet_spec.rb +1 -1
  49. data/spec/moneta/adapters/kyotocabinet/standard_kyotocabinet_spec.rb +2 -2
  50. data/spec/moneta/adapters/kyotocabinet/standard_kyotocabinet_with_expires_spec.rb +2 -2
  51. data/spec/moneta/adapters/leveldb/standard_leveldb_spec.rb +1 -1
  52. data/spec/moneta/adapters/leveldb/standard_leveldb_with_expires_spec.rb +1 -1
  53. data/spec/moneta/adapters/lmdb/standard_lmdb_spec.rb +1 -1
  54. data/spec/moneta/adapters/lmdb/standard_lmdb_with_expires_spec.rb +1 -1
  55. data/spec/moneta/adapters/lruhash/standard_lruhash_spec.rb +1 -1
  56. data/spec/moneta/adapters/lruhash/standard_lruhash_with_expires_spec.rb +1 -1
  57. data/spec/moneta/adapters/memory/standard_memory_spec.rb +1 -1
  58. data/spec/moneta/adapters/memory/standard_memory_with_compress_spec.rb +1 -1
  59. data/spec/moneta/adapters/memory/standard_memory_with_expires_spec.rb +1 -1
  60. data/spec/moneta/adapters/memory/standard_memory_with_json_key_serializer_spec.rb +1 -1
  61. data/spec/moneta/adapters/memory/standard_memory_with_json_serializer_spec.rb +1 -1
  62. data/spec/moneta/adapters/memory/standard_memory_with_json_value_serializer_spec.rb +2 -2
  63. data/spec/moneta/adapters/memory/standard_memory_with_prefix_spec.rb +39 -2
  64. data/spec/moneta/adapters/memory/standard_memory_with_snappy_compress_spec.rb +2 -2
  65. data/spec/moneta/adapters/mongo/adapter_mongo_moped_spec.rb +4 -3
  66. data/spec/moneta/adapters/mongo/adapter_mongo_moped_with_default_expires_spec.rb +5 -3
  67. data/spec/moneta/adapters/mongo/adapter_mongo_official_spec.rb +4 -2
  68. data/spec/moneta/adapters/mongo/adapter_mongo_official_with_default_expires_spec.rb +5 -3
  69. data/spec/moneta/adapters/mongo/adapter_mongo_spec.rb +3 -2
  70. data/spec/moneta/adapters/mongo/adapter_mongo_with_default_expires_spec.rb +5 -3
  71. data/spec/moneta/adapters/mongo/standard_mongo_moped_spec.rb +2 -2
  72. data/spec/moneta/adapters/mongo/standard_mongo_official_spec.rb +2 -2
  73. data/spec/moneta/adapters/mongo/standard_mongo_spec.rb +2 -2
  74. data/spec/moneta/adapters/pstore/standard_pstore_spec.rb +1 -1
  75. data/spec/moneta/adapters/pstore/standard_pstore_with_expires_spec.rb +1 -1
  76. data/spec/moneta/adapters/redis/standard_redis_spec.rb +1 -1
  77. data/spec/moneta/adapters/sdbm/standard_sdbm_spec.rb +1 -1
  78. data/spec/moneta/adapters/sdbm/standard_sdbm_with_expires_spec.rb +1 -1
  79. data/spec/moneta/adapters/sequel/standard_sequel_spec.rb +1 -1
  80. data/spec/moneta/adapters/sequel/standard_sequel_with_expires_spec.rb +1 -1
  81. data/spec/moneta/adapters/sqlite/standard_sqlite_spec.rb +1 -1
  82. data/spec/moneta/adapters/sqlite/standard_sqlite_with_expires_spec.rb +1 -1
  83. data/spec/moneta/adapters/tdb/standard_tdb_spec.rb +1 -1
  84. data/spec/moneta/adapters/tdb/standard_tdb_with_expires_spec.rb +1 -1
  85. data/spec/moneta/adapters/tokyocabinet/standard_tokyocabinet_spec.rb +1 -1
  86. data/spec/moneta/adapters/tokyocabinet/standard_tokyocabinet_with_expires_spec.rb +1 -1
  87. data/spec/moneta/adapters/yaml/standard_yaml_spec.rb +1 -1
  88. data/spec/moneta/adapters/yaml/standard_yaml_with_expires_spec.rb +1 -1
  89. data/spec/moneta/builder_spec.rb +22 -0
  90. data/spec/moneta/proxies/expires/expires_file_spec.rb +1 -1
  91. data/spec/moneta/proxies/shared/shared_tcp_spec.rb +14 -4
  92. data/spec/moneta/proxies/shared/shared_unix_spec.rb +4 -4
  93. data/spec/moneta/proxies/transformer/transformer_bencode_spec.rb +1 -1
  94. data/spec/moneta/proxies/transformer/transformer_bert_spec.rb +3 -3
  95. data/spec/moneta/proxies/transformer/transformer_bson_spec.rb +2 -2
  96. data/spec/moneta/proxies/transformer/transformer_json_spec.rb +1 -1
  97. data/spec/moneta/proxies/transformer/transformer_key_marshal_spec.rb +1 -1
  98. data/spec/moneta/proxies/transformer/transformer_key_yaml_spec.rb +1 -1
  99. data/spec/moneta/proxies/transformer/transformer_marshal_base64_spec.rb +1 -1
  100. data/spec/moneta/proxies/transformer/transformer_marshal_escape_spec.rb +1 -1
  101. data/spec/moneta/proxies/transformer/transformer_marshal_hex_spec.rb +1 -1
  102. data/spec/moneta/proxies/transformer/transformer_marshal_hmac_spec.rb +1 -1
  103. data/spec/moneta/proxies/transformer/transformer_marshal_prefix_base64_spec.rb +33 -0
  104. data/spec/moneta/proxies/transformer/transformer_marshal_prefix_spec.rb +1 -1
  105. data/spec/moneta/proxies/transformer/transformer_marshal_qp_spec.rb +1 -1
  106. data/spec/moneta/proxies/transformer/transformer_marshal_spec.rb +1 -1
  107. data/spec/moneta/proxies/transformer/transformer_marshal_urlsafe_base64_spec.rb +1 -1
  108. data/spec/moneta/proxies/transformer/transformer_marshal_uuencode_spec.rb +1 -1
  109. data/spec/moneta/proxies/transformer/transformer_msgpack_spec.rb +1 -1
  110. data/spec/moneta/proxies/transformer/transformer_ox_spec.rb +1 -1
  111. data/spec/moneta/proxies/transformer/transformer_php_spec.rb +1 -1
  112. data/spec/moneta/proxies/transformer/transformer_tnet_spec.rb +1 -1
  113. data/spec/moneta/proxies/transformer/transformer_yaml_spec.rb +2 -2
  114. data/spec/moneta/proxies/weak_each_key/weak_each_key_spec.rb +0 -2
  115. data/spec/support/mongo_helper.rb +12 -0
  116. metadata +18 -12
  117. data/script/reconfigure-couchdb +0 -13
@@ -7,5 +7,5 @@ describe 'standard_tdb_with_expires', unsupported: defined?(JRUBY_VERSION), adap
7
7
  {file: File.join(tempdir, "simple_tdb_with_expires"), expires: true}
8
8
  end
9
9
 
10
- moneta_specs STANDARD_SPECS.without_multiprocess.with_expires
10
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_expires.with_each_key
11
11
  end
@@ -3,5 +3,5 @@ describe 'standard_tokyocabinet', unsupported: defined?(JRUBY_VERSION), adapter:
3
3
  {file: File.join(tempdir, "simple_tokyocabinet")}
4
4
  end
5
5
 
6
- moneta_specs STANDARD_SPECS.without_multiprocess
6
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_each_key
7
7
  end
@@ -7,5 +7,5 @@ describe 'standard_tokyocabinet_with_expires', unsupported: defined?(JRUBY_VERSI
7
7
  {file: File.join(tempdir, "simple_tokyocabinet_with_expires"), expires: true}
8
8
  end
9
9
 
10
- moneta_specs STANDARD_SPECS.without_multiprocess.with_expires
10
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_expires.with_each_key
11
11
  end
@@ -5,5 +5,5 @@ describe 'standard_yaml', adapter: :YAML do
5
5
 
6
6
  moneta_loader{ |value| value }
7
7
 
8
- moneta_specs STANDARD_SPECS.without_marshallable_value.without_concurrent
8
+ moneta_specs STANDARD_SPECS.without_marshallable_value.without_concurrent.with_each_key
9
9
  end
@@ -9,5 +9,5 @@ describe 'standard_yaml_with_expires', adapter: :YAML do
9
9
 
10
10
  moneta_loader{ |value| value }
11
11
 
12
- moneta_specs STANDARD_SPECS.without_marshallable_value.with_expires.without_concurrent
12
+ moneta_specs STANDARD_SPECS.without_marshallable_value.with_expires.without_concurrent.with_each_key
13
13
  end
@@ -25,4 +25,26 @@ describe Moneta::Builder do
25
25
  end.build
26
26
  end.to raise_error /Please check/
27
27
  end
28
+
29
+ it 'dups options before passing them to each middleware' do
30
+ my_adapter = Class.new do
31
+ def initialize(options)
32
+ throw "a is missing" unless options.delete(:a)
33
+ end
34
+ end
35
+
36
+ my_middleware = Class.new do
37
+ def initialize(backend, options)
38
+ throw "a is missing" unless options.delete(:a)
39
+ end
40
+ end
41
+
42
+ options = { a: 1 }
43
+ Moneta::Builder.new do
44
+ use my_middleware, options
45
+ adapter my_adapter, options
46
+ end.build
47
+
48
+ expect(options).to include(a: 1)
49
+ end
28
50
  end
@@ -13,7 +13,7 @@ describe 'expires_file', proxy: :Expires do
13
13
  end
14
14
  end
15
15
 
16
- moneta_specs STANDARD_SPECS.with_expires.stringvalues_only
16
+ moneta_specs STANDARD_SPECS.with_expires.stringvalues_only.with_each_key
17
17
 
18
18
  it 'deletes expired value in underlying file storage' do
19
19
  store.store('foo', 'bar', expires: 2)
@@ -1,15 +1,15 @@
1
- describe "shared_tcp", isolate: true, proxy: :Shared do
1
+ describe "shared_tcp", proxy: :Shared do
2
2
  moneta_build do
3
3
  tempdir = self.tempdir
4
4
  Moneta.build do
5
5
  use(:Shared, port: 9001) do
6
- adapter :PStore, file: File.join(tempdir, 'shared_tcp')
6
+ adapter :GDBM, file: File.join(tempdir, 'shared_tcp')
7
7
  end
8
8
  end
9
9
  end
10
10
 
11
11
  shared_examples :shared_tcp do
12
- moneta_specs ADAPTER_SPECS
12
+ moneta_specs ADAPTER_SPECS.with_each_key
13
13
 
14
14
  it 'shares values' do
15
15
  store['shared_key'] = 'shared_value'
@@ -22,11 +22,16 @@ describe "shared_tcp", isolate: true, proxy: :Shared do
22
22
 
23
23
  # The first store initialised will be running the server
24
24
  context "running as the server" do
25
+ before do
26
+ store.load('dummy')
27
+ expect(store.server?).to be true
28
+ end
29
+
25
30
  include_examples :shared_tcp
26
31
 
27
32
  it 'has the underlying adapter' do
28
33
  store.load('dummy')
29
- expect(store.adapter.adapter).to be_a Moneta::Adapters::PStore
34
+ expect(store.adapter.adapter).to be_a Moneta::Adapters::GDBM
30
35
  end
31
36
  end
32
37
 
@@ -35,6 +40,11 @@ describe "shared_tcp", isolate: true, proxy: :Shared do
35
40
  new_store.tap { |store| store.load('dummy') } # Makes a connection
36
41
  end
37
42
 
43
+ before do
44
+ store.load('dummy')
45
+ expect(store.server?).to be false
46
+ end
47
+
38
48
  after do
39
49
  server_store.close
40
50
  end
@@ -1,15 +1,15 @@
1
- describe "shared_unix", isolate: true, proxy: :Shared do
1
+ describe "shared_unix", proxy: :Shared do
2
2
  moneta_build do
3
3
  tempdir = self.tempdir
4
4
  Moneta.build do
5
5
  use(:Shared, socket: File.join(tempdir, 'shared_unix.socket')) do
6
- adapter :PStore, file: File.join(tempdir, 'shared_unix')
6
+ adapter :GDBM, file: File.join(tempdir, 'shared_unix')
7
7
  end
8
8
  end
9
9
  end
10
10
 
11
11
  shared_examples :shared_unix do
12
- moneta_specs ADAPTER_SPECS
12
+ moneta_specs ADAPTER_SPECS.with_each_key
13
13
 
14
14
  it 'shares values' do
15
15
  store['shared_key'] = 'shared_value'
@@ -25,7 +25,7 @@ describe "shared_unix", isolate: true, proxy: :Shared do
25
25
 
26
26
  it "has the underlying adapter" do
27
27
  store.load('dummy')
28
- expect(store.adapter.adapter).to be_a Moneta::Adapters::PStore
28
+ expect(store.adapter.adapter).to be_a Moneta::Adapters::GDBM
29
29
  end
30
30
  end
31
31
 
@@ -10,7 +10,7 @@ describe 'transformer_bencode', proxy: :Transformer do
10
10
  ::BEncode.load(value)
11
11
  end
12
12
 
13
- moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only
13
+ moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only.with_each_key
14
14
 
15
15
  it 'compile transformer class' do
16
16
  store.should_not be_nil
@@ -9,9 +9,9 @@ describe 'transformer_bert', unsupported: defined?(JRUBY_VERSION), proxy: :Trans
9
9
  moneta_loader do |value|
10
10
  ::BERT.decode(value)
11
11
  end
12
-
13
- moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only
14
-
12
+
13
+ moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only.with_each_key
14
+
15
15
  it 'compile transformer class' do
16
16
  store.should_not be_nil
17
17
  Moneta::Transformer::BertKeyBertValue.should_not be_nil
@@ -14,8 +14,8 @@ describe 'transformer_bson', proxy: :Transformer do
14
14
  end
15
15
  end
16
16
 
17
- moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only
18
-
17
+ moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only.with_each_key
18
+
19
19
  it 'compile transformer class' do
20
20
  store.should_not be_nil
21
21
  Moneta::Transformer::BsonKeyBsonValue.should_not be_nil
@@ -10,7 +10,7 @@ describe 'transformer_json', proxy: :Transformer do
10
10
  ::MultiJson.load(value)
11
11
  end
12
12
 
13
- moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only
13
+ moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only.with_each_key
14
14
 
15
15
  it 'compile transformer class' do
16
16
  store.should_not be_nil
@@ -8,7 +8,7 @@ describe 'transformer_key_marshal', proxy: :Transformer do
8
8
 
9
9
  moneta_loader{ |value| value }
10
10
 
11
- moneta_specs TRANSFORMER_SPECS.returnsame
11
+ moneta_specs TRANSFORMER_SPECS.returnsame.with_each_key
12
12
 
13
13
  it 'compile transformer class' do
14
14
  store.should_not be_nil
@@ -8,7 +8,7 @@ describe 'transformer_key_yaml', proxy: :Transformer do
8
8
 
9
9
  moneta_loader{ |value| value }
10
10
 
11
- moneta_specs TRANSFORMER_SPECS.returnsame
11
+ moneta_specs TRANSFORMER_SPECS.returnsame.with_each_key
12
12
 
13
13
  it 'compile transformer class' do
14
14
  store.should_not be_nil
@@ -11,7 +11,7 @@ describe 'transformer_marshal_base64', proxy: :Transformer do
11
11
  ::Marshal.load(value.unpack('m').first)
12
12
  end
13
13
 
14
- moneta_specs STANDARD_SPECS.without_persist
14
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
15
15
 
16
16
  it 'compile transformer class' do
17
17
  store.should_not be_nil
@@ -10,7 +10,7 @@ describe 'transformer_marshal_escape', proxy: :Transformer do
10
10
  ::Marshal.load(::URI.decode_www_form_component(value))
11
11
  end
12
12
 
13
- moneta_specs STANDARD_SPECS.without_persist
13
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
14
14
 
15
15
  it 'compiles the transformer class' do
16
16
  store.should_not be_nil
@@ -11,7 +11,7 @@ describe 'transformer_marshal_hex', proxy: :Transformer do
11
11
  ::Marshal.load([value].pack('H*'))
12
12
  end
13
13
 
14
- moneta_specs STANDARD_SPECS.without_persist
14
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
15
15
 
16
16
  it 'compile transformer class' do
17
17
  store.should_not be_nil
@@ -10,7 +10,7 @@ describe 'transformer_marshal_hmac', proxy: :Transformer do
10
10
  ::Marshal.load(::Moneta::Transformer::Helper.hmacverify(value, 'secret'))
11
11
  end
12
12
 
13
- moneta_specs STANDARD_SPECS.without_persist
13
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
14
14
 
15
15
  it 'compile transformer class' do
16
16
  store.should_not be_nil
@@ -0,0 +1,33 @@
1
+ describe 'transformer_marshal_prefix_base64', proxy: :Transformer do
2
+ moneta_build do
3
+
4
+ Moneta.build do
5
+ use :Transformer, key: [:marshal, :prefix, :base64], value: [:marshal, :base64], prefix: 'moneta'
6
+ adapter :Memory
7
+ end
8
+ end
9
+
10
+ moneta_loader do |value|
11
+ ::Marshal.load(value.unpack('m').first)
12
+ end
13
+
14
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
15
+
16
+ it 'compile transformer class' do
17
+ store.should_not be_nil
18
+ Moneta::Transformer::MarshalPrefixBase64KeyMarshalBase64Value.should_not be_nil
19
+ end
20
+
21
+ context 'with keys with no prefix' do
22
+ before(:each) do
23
+ store.adapter.backend['no_prefix'] = 'hidden'
24
+ end
25
+
26
+ after(:each) do
27
+ expect(store.adapter.backend.keys).to include('no_prefix')
28
+ end
29
+
30
+ include_examples :each_key
31
+ end
32
+
33
+ end
@@ -6,7 +6,7 @@ describe 'transformer_marshal_prefix', proxy: :Transformer do
6
6
  end
7
7
  end
8
8
 
9
- moneta_specs STANDARD_SPECS.without_persist
9
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
10
10
 
11
11
  it 'compile transformer class' do
12
12
  store.should_not be_nil
@@ -11,7 +11,7 @@ describe 'transformer_marshal_qp', proxy: :Transformer do
11
11
  ::Marshal.load(value.unpack('M').first)
12
12
  end
13
13
 
14
- moneta_specs STANDARD_SPECS.without_persist
14
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
15
15
 
16
16
  it 'compile transformer class' do
17
17
  store.should_not be_nil
@@ -10,7 +10,7 @@ describe 'transformer_marshal', proxy: :Transformer do
10
10
  ::Marshal.load(value)
11
11
  end
12
12
 
13
- moneta_specs TRANSFORMER_SPECS
13
+ moneta_specs TRANSFORMER_SPECS.with_each_key
14
14
 
15
15
  it 'compile transformer class' do
16
16
  store.should_not be_nil
@@ -11,7 +11,7 @@ describe 'transformer_marshal_urlsafe_base64', proxy: :Transformer do
11
11
  ::Marshal.load(::Base64.urlsafe_decode64(value))
12
12
  end
13
13
 
14
- moneta_specs STANDARD_SPECS.without_persist
14
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
15
15
 
16
16
  it 'compile transformer class' do
17
17
  store.should_not be_nil
@@ -10,7 +10,7 @@ describe 'transformer_marshal_uuencode', proxy: :Transformer do
10
10
  ::Marshal.load(value.unpack('u').first)
11
11
  end
12
12
 
13
- moneta_specs STANDARD_SPECS.without_persist
13
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
14
14
 
15
15
  it 'compile transformer class' do
16
16
  store.should_not be_nil
@@ -10,7 +10,7 @@ describe 'transformer_msgpack', proxy: :Transformer do
10
10
  ::MessagePack.unpack(value)
11
11
  end
12
12
 
13
- moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only
13
+ moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only.with_each_key
14
14
 
15
15
  it 'compile transformer class' do
16
16
  store.should_not be_nil
@@ -10,7 +10,7 @@ describe 'transformer_ox', unsupported: defined?(JRUBY_VERSION), proxy: :Transfo
10
10
  ::Ox.parse_obj(value)
11
11
  end
12
12
 
13
- moneta_specs TRANSFORMER_SPECS.without_keys_or_values(:binary, :float)
13
+ moneta_specs TRANSFORMER_SPECS.without_keys_or_values(:binary, :float).with_each_key
14
14
 
15
15
  it 'compile transformer class' do
16
16
  store.should_not be_nil
@@ -10,7 +10,7 @@ describe 'transformer_php', proxy: :Transformer do
10
10
  ::PHP.unserialize(value)
11
11
  end
12
12
 
13
- moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only
13
+ moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only.with_each_key
14
14
 
15
15
  it 'compile transformer class' do
16
16
  store.should_not be_nil
@@ -10,7 +10,7 @@ describe 'transformer_tnet', proxy: :Transformer do
10
10
  ::TNetstring.parse(value).first
11
11
  end
12
12
 
13
- moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only
13
+ moneta_specs TRANSFORMER_SPECS.simplekeys_only.simplevalues_only.with_each_key
14
14
 
15
15
  it 'compile transformer class' do
16
16
  store.should_not be_nil
@@ -9,8 +9,8 @@ describe 'transformer_yaml', proxy: :Transformer do
9
9
  moneta_loader do |value|
10
10
  ::YAML.load(value)
11
11
  end
12
-
13
- moneta_specs TRANSFORMER_SPECS
12
+
13
+ moneta_specs TRANSFORMER_SPECS.with_each_key
14
14
 
15
15
  it 'compile transformer class' do
16
16
  store.should_not be_nil
@@ -9,8 +9,6 @@ describe 'weak_each_key', proxy: :WeakEachKey do
9
9
  moneta_build do
10
10
  Moneta.build do
11
11
  use :WeakEachKey
12
- # use :WeakIncrement
13
- # use :WeakCreate
14
12
 
15
13
  adapter :Fog,
16
14
  aws_access_key_id: 'fake_access_key_id',
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MongoHelper
4
+ def mongo_config(opts = {})
5
+ prefix = ENV.fetch('TEST_ENV_NUMBER', '')
6
+ opts.merge(collection: "#{prefix}#{opts[:collection]}")
7
+ end
8
+
9
+ def self.mongo_config(args)
10
+ Class.include(MongoHelper).new.mongo_config(args)
11
+ end
12
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moneta
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Mendler
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-11-08 00:00:00.000000000 Z
14
+ date: 2020-04-27 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec
@@ -101,16 +101,16 @@ dependencies:
101
101
  name: irb
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - "~>"
104
+ - - '='
105
105
  - !ruby/object:Gem::Version
106
- version: 1.0.0
106
+ version: 1.2.1
107
107
  type: :development
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - "~>"
111
+ - - '='
112
112
  - !ruby/object:Gem::Version
113
- version: 1.0.0
113
+ version: 1.2.1
114
114
  description: A unified interface to key/value stores
115
115
  email:
116
116
  - mail@daniel-mendler.de
@@ -211,7 +211,7 @@ files:
211
211
  - script/contributors
212
212
  - script/memusage
213
213
  - script/parallel-tests
214
- - script/reconfigure-couchdb
214
+ - script/start-couchdb
215
215
  - script/start-hbase
216
216
  - script/start-services
217
217
  - script/travis-logs
@@ -254,6 +254,7 @@ files:
254
254
  - spec/moneta/adapters/cassandra/helper.rb
255
255
  - spec/moneta/adapters/cassandra/standard_cassandra_spec.rb
256
256
  - spec/moneta/adapters/client/adapter_client_spec.rb
257
+ - spec/moneta/adapters/client/client_helper.rb
257
258
  - spec/moneta/adapters/client/standard_client_tcp_spec.rb
258
259
  - spec/moneta/adapters/client/standard_client_unix_spec.rb
259
260
  - spec/moneta/adapters/cookie/adapter_cookie_spec.rb
@@ -403,6 +404,7 @@ files:
403
404
  - spec/moneta/proxies/transformer/transformer_marshal_hmac_spec.rb
404
405
  - spec/moneta/proxies/transformer/transformer_marshal_md5_spec.rb
405
406
  - spec/moneta/proxies/transformer/transformer_marshal_md5_spread_spec.rb
407
+ - spec/moneta/proxies/transformer/transformer_marshal_prefix_base64_spec.rb
406
408
  - spec/moneta/proxies/transformer/transformer_marshal_prefix_spec.rb
407
409
  - spec/moneta/proxies/transformer/transformer_marshal_qp_spec.rb
408
410
  - spec/moneta/proxies/transformer/transformer_marshal_rmd160_spec.rb
@@ -436,6 +438,7 @@ files:
436
438
  - spec/rack/moneta_store_spec.rb
437
439
  - spec/rack/session_moneta_spec.rb
438
440
  - spec/restserver.rb
441
+ - spec/support/mongo_helper.rb
439
442
  - test/action_dispatch/fixtures/session_autoload_test/foo.rb
440
443
  - test/action_dispatch/session_moneta_store_test.rb
441
444
  homepage: https://github.com/moneta-rb/moneta
@@ -443,9 +446,9 @@ licenses:
443
446
  - MIT
444
447
  metadata:
445
448
  bug_tracker_uri: https://github.com/moneta-rb/moneta/issues
446
- changelog_uri: https://github.com/moneta-rb/moneta/blob/v1.2.1/CHANGES
447
- documentation_uri: https://www.rubydoc.info/gems/moneta/1.2.1
448
- source_code_uri: https://github.com/moneta-rb/moneta/tree/v1.2.1
449
+ changelog_uri: https://github.com/moneta-rb/moneta/blob/v1.3.0/CHANGES
450
+ documentation_uri: https://www.rubydoc.info/gems/moneta/1.3.0
451
+ source_code_uri: https://github.com/moneta-rb/moneta/tree/v1.3.0
449
452
  post_install_message:
450
453
  rdoc_options: []
451
454
  require_paths:
@@ -454,14 +457,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
454
457
  requirements:
455
458
  - - ">="
456
459
  - !ruby/object:Gem::Version
457
- version: 2.2.2
460
+ version: 2.3.0
458
461
  required_rubygems_version: !ruby/object:Gem::Requirement
459
462
  requirements:
460
463
  - - ">="
461
464
  - !ruby/object:Gem::Version
462
465
  version: '0'
463
466
  requirements: []
464
- rubygems_version: 3.0.6
467
+ rubygems_version: 3.1.2
465
468
  signing_key:
466
469
  specification_version: 4
467
470
  summary: A unified interface to key/value stores, including Redis, Memcached, TokyoCabinet,
@@ -505,6 +508,7 @@ test_files:
505
508
  - spec/moneta/adapters/cassandra/helper.rb
506
509
  - spec/moneta/adapters/cassandra/standard_cassandra_spec.rb
507
510
  - spec/moneta/adapters/client/adapter_client_spec.rb
511
+ - spec/moneta/adapters/client/client_helper.rb
508
512
  - spec/moneta/adapters/client/standard_client_tcp_spec.rb
509
513
  - spec/moneta/adapters/client/standard_client_unix_spec.rb
510
514
  - spec/moneta/adapters/cookie/adapter_cookie_spec.rb
@@ -654,6 +658,7 @@ test_files:
654
658
  - spec/moneta/proxies/transformer/transformer_marshal_hmac_spec.rb
655
659
  - spec/moneta/proxies/transformer/transformer_marshal_md5_spec.rb
656
660
  - spec/moneta/proxies/transformer/transformer_marshal_md5_spread_spec.rb
661
+ - spec/moneta/proxies/transformer/transformer_marshal_prefix_base64_spec.rb
657
662
  - spec/moneta/proxies/transformer/transformer_marshal_prefix_spec.rb
658
663
  - spec/moneta/proxies/transformer/transformer_marshal_qp_spec.rb
659
664
  - spec/moneta/proxies/transformer/transformer_marshal_rmd160_spec.rb
@@ -687,5 +692,6 @@ test_files:
687
692
  - spec/rack/moneta_store_spec.rb
688
693
  - spec/rack/session_moneta_spec.rb
689
694
  - spec/restserver.rb
695
+ - spec/support/mongo_helper.rb
690
696
  - test/action_dispatch/fixtures/session_autoload_test/foo.rb
691
697
  - test/action_dispatch/session_moneta_store_test.rb