moneta 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 057afad07820c6a0099c1c8f0d08e8a8db0d8f163ae699a6c492b5114e7690da
4
- data.tar.gz: 277352fb763982da85855f170234cf6a2660afeb3b90f6bf34df6dccda586291
3
+ metadata.gz: 61d01584fc8497503e70aa6cb4fcea5ead6a05b9f4f1c2c9db138cd0470f948f
4
+ data.tar.gz: b7e2822f9aac62ab718964f4f8a3b4bf7a4473aa6ab9291b0df28882a3de2bca
5
5
  SHA512:
6
- metadata.gz: 0266a4e3016c53408a92a5929152f088ff26c0981561e279e0812726a085e65a6ea90305d362ca04383ee0225915bd470f687c97d9eeafeff960ca21de716616
7
- data.tar.gz: 95f6df87a40afeeff7d0c490c88f9c9950a12949358df57da9014cff3ffba1e7893ca43cdfb1d90c20750050d6bc0617e76655a025bff58caa1c89567256a894
6
+ metadata.gz: fd8eb44d64eb8b62529497770bbea915fdd6880e907d697de82156aa1c9ca2f7bb58b7bb68157eefab138a8bc9aab8debf4186d4a8828bb664385c59027cd2a3
7
+ data.tar.gz: 1d97a4b4de9f0242fa260e1b197d35333a527019c43b01fab3a913c3f833a5963b47776ac78c3b9da7be70a117eaafcbb09e81108b233135ea6a018280f1b3a3
@@ -343,7 +343,7 @@ jobs:
343
343
 
344
344
  services:
345
345
  mongo:
346
- image: mongo
346
+ image: mongo:4.4
347
347
  options: >-
348
348
  --health-cmd "mongo --eval db"
349
349
  --health-interval 10s
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ 1.5.2
2
+
3
+ * Proxy - handle returning config when the adapter does not use config
4
+ * Avoid calling `supports?(:expires)` when expiry isn't needed
5
+ * Adapters::Mongo - fix `merge!` behaviour when no values are inserted
6
+
1
7
  1.5.1
2
8
 
3
9
  * Adapters::File - fix an implicit hash issue in Ruby 3 (#222)
data/CONTRIBUTORS CHANGED
@@ -3,11 +3,13 @@ Alastair Pharo <me@asph.dev>
3
3
  Alejandro Crosa <acrosa@sharing.local>
4
4
  Alessio Signorini <alessio@signorini.us>
5
5
  Anthony Eden <anthonyeden@gmail.com>
6
+ Antoine Beaupré <anarcat@debian.org>
6
7
  Antonio Terceiro <terceiro@debian.org>
7
8
  Atoxhybrid <atoxhybrid@gmail.com>
8
9
  AtoxIO <atoxhybrid@gmail.com>
9
10
  Ben Schwarz <ben.schwarz@gmail.com>
10
11
  Benjamin Yu <benjaminlyu@gmail.com>
12
+ Corey Smith <korkey128k@gmail.com>
11
13
  Daniel Mendler <mail@daniel-mendler.de>
12
14
  Denis Defreyne <denis.defreyne@stoneship.org>
13
15
  Derek Kastner <dkastner@gmail.com>
@@ -34,6 +36,7 @@ Quin Hoxie <quin@aboutus.org>
34
36
  Ryan T. Hosford <tad.hosford@gmail.com>
35
37
  Scott Wadden <scott.wadden@gmail.com>
36
38
  Sven Riedel <sr@gimp.org>
39
+ Thomas R. Koll <tomk32@tomk32.de>
37
40
  Timo Goebel <timo.goebel@dm.de>
38
41
  Tom Meier <ozmeier@yahoo.co.uk>
39
42
  Tony Han <h.bing612@gmail.com>
data/Gemfile CHANGED
@@ -52,10 +52,6 @@ group :transformers, optional: true do
52
52
  gem 'snappy', platforms: :ruby
53
53
  end
54
54
 
55
- group :quicklz, optional: true do
56
- gem 'qlzruby', platforms: :ruby
57
- end
58
-
59
55
  # Hash transformer library
60
56
  group :city, optional: true do
61
57
  gem 'cityhash', platforms: :ruby
@@ -171,7 +167,7 @@ end
171
167
 
172
168
  group :sqlite, optional: true do
173
169
  gem 'activerecord-jdbcsqlite3-adapter', platforms: :jruby
174
- gem 'sqlite3', '~> 1.3.6', platforms: :ruby
170
+ gem 'sqlite3', '~> 1.5.3', platforms: :ruby
175
171
  end
176
172
 
177
173
  group :postgresql, optional: true do
data/README.md CHANGED
@@ -106,11 +106,11 @@ Out of the box, it supports the following backends. Use the backend name symbol
106
106
  * Key/value databases:
107
107
  * [Berkeley DB using DBM interface or NDBM (Depends on Ruby environment)](http://www.ruby-doc.org/stdlib/libdoc/dbm/rdoc/DBM.html) (`:DBM`)
108
108
  * [Cassandra](http://cassandra.apache.org/) (`:Cassandra`)
109
- * [Daybreak](http://propublica.github.com/daybreak/) (`:Daybreak`)
109
+ * [Daybreak](https://propublica.github.io/daybreak/) (`:Daybreak`)
110
110
  * [GDBM](http://www.ruby-doc.org/stdlib/libdoc/gdbm/rdoc/GDBM.html) (`:GDBM`)
111
111
  * [HBase](http://hbase.apache.org/) (`:HBase`)
112
112
  * [LevelDB](http://code.google.com/p/leveldb/) (`:LevelDB`)
113
- * [LMDB](http://symas.com/mdb/) (`:LMDB`)
113
+ * [LMDB](http://symas.com/lmdb) (`:LMDB`)
114
114
  * [Redis](http://redis.io/) (`:Redis`)
115
115
  * [Riak](http://docs.basho.com/) (`:Riak`)
116
116
  * [SDBM](http://www.ruby-doc.org/stdlib/libdoc/sdbm/rdoc/SDBM.html) (`:SDBM`)
@@ -150,7 +150,7 @@ __NOTE:__ <a name="backend-matrix"></a>The backend matrix is much more readable
150
150
 
151
151
  <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>
152
152
 
153
- <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>
153
+ <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/lmdb">Symas Lightning Memory-Mapped Database (LMDB)</a></td></tr>
154
154
 
155
155
  <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>
156
156
 
@@ -221,9 +221,7 @@ __NOTE:__ <a name="backend-matrix"></a>The backend matrix is much more readable
221
221
  3. Share a Moneta store between multiple processes using `Moneta::Shared` (See below).
222
222
  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.
223
223
  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.
224
- 6. Add expiration support by using `Moneta::Expires` or by passing the option
225
- `expires: true` (or `expires: <seconds>` if you want all values to expire by
226
- default) to `Moneta#new`.
224
+ 6. Add expiration support by using `Moneta::Expires` or by passing the option `expires: true` to `Moneta#new`.
227
225
  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.
228
226
  8. This indicates that there is some performance gain when storing multiple key/value pairs at once using `#merge!`/`#update`.
229
227
  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!
data/feature_matrix.yaml CHANGED
@@ -30,7 +30,7 @@ backends:
30
30
  platforms: [ MRI ]
31
31
  gems: lmdb
32
32
  features: [ threadsafe, multiprocess, increment, create, each_key, bulk_read, bulk_write ]
33
- description: "[Symas Lightning Memory-Mapped Database (LMDB)](http://symas.com/mdb/)"
33
+ description: "[Symas Lightning Memory-Mapped Database (LMDB)](http://symas.com/lmdb)"
34
34
  - adapter: Sequel
35
35
  platforms: [ MRI, JRuby ]
36
36
  gems: sequel
@@ -164,9 +164,11 @@ module Moneta
164
164
  existing = Hash[slice(*pairs.map { |key, _| key })]
165
165
  update_pairs, insert_pairs = pairs.partition { |key, _| existing.key?(key) }
166
166
 
167
- @collection.insert_many(insert_pairs.map do |key, value|
168
- value_to_doc(to_binary(key), value, options)
169
- end)
167
+ unless insert_pairs.empty?
168
+ @collection.insert_many(insert_pairs.map do |key, value|
169
+ value_to_doc(to_binary(key), value, options)
170
+ end)
171
+ end
170
172
 
171
173
  update_pairs.each do |key, value|
172
174
  value = yield(key, existing[key], value) if block_given?
data/lib/moneta/proxy.rb CHANGED
@@ -145,7 +145,7 @@ module Moneta
145
145
  def config
146
146
  unless @proxy_config
147
147
  config = super
148
- adapter_config = adapter&.config
148
+ adapter_config = adapter.config if adapter.class.include?(Config)
149
149
 
150
150
  @proxy_config =
151
151
  if config && adapter_config
@@ -1,5 +1,5 @@
1
1
  module Moneta
2
2
  # Moneta version number
3
3
  # @api public
4
- VERSION = '1.5.1'.freeze
4
+ VERSION = '1.5.2'.freeze
5
5
  end
data/lib/moneta.rb CHANGED
@@ -144,7 +144,7 @@ module Moneta
144
144
  a = Adapters.const_get(name).new(options)
145
145
  build do
146
146
  use :Logger, Hash === logger ? logger : {} if logger
147
- use :Expires, expires: options[:expires] if !a.supports?(:expires) && expires
147
+ use :Expires, expires: options[:expires] if expires && !a.supports?(:expires)
148
148
  use :Transformer, transformer
149
149
  use :Lock if threadsafe
150
150
  adapter a
data/spec/helper.rb CHANGED
@@ -269,6 +269,7 @@ module MonetaHelpers
269
269
  # want to run the tests but don't want to grant root access to moneta
270
270
  let(:mysql_host) { ENV['MYSQL_HOST'] || 'localhost' }
271
271
  let(:mysql_port) { ENV['MYSQL_TCP_PORT'] || '3306' }
272
+ let(:mysql_socket) { ENV['MYSQL_SOCKET'] }
272
273
  let(:mysql_username) { ENV['MONETA_MYSQL_USERNAME'] || 'root' }
273
274
  let(:mysql_password) { ENV['MONETA_MYSQL_PASSWORD'] }
274
275
  let(:mysql_database1) { ENV['MONETA_MYSQL_DATABASE1'] || 'moneta' }
@@ -1,4 +1,4 @@
1
- describe 'adapter_activerecord_existing_connection', adapter: :ActiveRecord, mysql: true do
1
+ describe 'adapter_activerecord_existing_connection', adapter: :ActiveRecord, mysql: true, broken: ::Gem::Version.new(RUBY_ENGINE_VERSION) >= ::Gem::Version.new('3.0.0') do
2
2
  before :all do
3
3
  require 'active_record'
4
4
  end
@@ -8,6 +8,7 @@ describe 'adapter_activerecord_existing_connection', adapter: :ActiveRecord, mys
8
8
  ActiveRecord::Base.configurations = {
9
9
  default_env => {
10
10
  'adapter' => (defined?(JRUBY_VERSION) ? 'jdbcmysql' : 'mysql2'),
11
+ 'socket' => mysql_socket,
11
12
  'host' => mysql_host,
12
13
  'port' => mysql_port,
13
14
  'database' => mysql_database1,
@@ -1,4 +1,4 @@
1
- describe 'adapter_activerecord', adapter: :ActiveRecord do
1
+ describe 'adapter_activerecord', adapter: :ActiveRecord, broken: ::Gem::Version.new(RUBY_ENGINE_VERSION) >= ::Gem::Version.new('3.0.0') do
2
2
  activerecord_specs = ADAPTER_SPECS.with_values(:nil).with_each_key
3
3
 
4
4
  shared_examples :adapter_activerecord do |specs|
@@ -64,6 +64,7 @@ describe 'adapter_activerecord', adapter: :ActiveRecord do
64
64
  adapter: (defined?(JRUBY_VERSION) ? 'jdbcmysql' : 'mysql2'),
65
65
  host: mysql_host,
66
66
  port: mysql_port,
67
+ socket: mysql_socket,
67
68
  database: mysql_database1,
68
69
  username: mysql_username,
69
70
  password: mysql_password
@@ -75,6 +76,7 @@ describe 'adapter_activerecord', adapter: :ActiveRecord do
75
76
  adapter: (defined?(JRUBY_VERSION) ? 'jdbcmysql' : 'mysql2'),
76
77
  host: mysql_host,
77
78
  port: mysql_port,
79
+ socket: mysql_socket,
78
80
  database: mysql_database2,
79
81
  username: mysql_username,
80
82
  password: mysql_password
@@ -1,4 +1,4 @@
1
- describe "standard_activerecord", adapter: :ActiveRecord, mysql: true do
1
+ describe "standard_activerecord", adapter: :ActiveRecord, mysql: true, broken: ::Gem::Version.new(RUBY_ENGINE_VERSION) >= ::Gem::Version.new('3.0.0') do
2
2
  moneta_store :ActiveRecord do
3
3
  {
4
4
  table: 'standard_activerecord',
@@ -6,6 +6,7 @@ describe "standard_activerecord", adapter: :ActiveRecord, mysql: true do
6
6
  adapter: (defined?(JRUBY_VERSION) ? 'jdbcmysql' : 'mysql2'),
7
7
  host: mysql_host,
8
8
  port: mysql_port,
9
+ socket: mysql_socket,
9
10
  database: mysql_database1,
10
11
  username: mysql_username,
11
12
  password: mysql_password
@@ -1,4 +1,4 @@
1
- describe "standard_activerecord_with_expires", adapter: :ActiveRecord, mysql: true do
1
+ describe "standard_activerecord_with_expires", adapter: :ActiveRecord, mysql: true, broken: ::Gem::Version.new(RUBY_ENGINE_VERSION) >= ::Gem::Version.new('3.0.0') do
2
2
  let(:t_res) { 0.125 }
3
3
  let(:min_ttl) { t_res }
4
4
  use_timecop
@@ -10,6 +10,7 @@ describe "standard_activerecord_with_expires", adapter: :ActiveRecord, mysql: tr
10
10
  adapter: (defined?(JRUBY_VERSION) ? 'jdbcmysql' : 'mysql2'),
11
11
  host: mysql_host,
12
12
  port: mysql_port,
13
+ socket: mysql_socket,
13
14
  database: mysql_database1,
14
15
  username: mysql_username,
15
16
  password: mysql_password
@@ -1,6 +1,6 @@
1
1
  require_relative '../memcached_helper.rb'
2
2
 
3
- describe 'adapter_activesupportcache', adapter: :ActiveSupportCache do
3
+ describe 'adapter_activesupportcache', adapter: :ActiveSupportCache, broken: ::Gem::Version.new(RUBY_ENGINE_VERSION) >= ::Gem::Version.new('3.0.0') do
4
4
  before :all do
5
5
  require 'active_support'
6
6
  require 'active_support/cache/moneta_store'
@@ -1,6 +1,6 @@
1
1
  require_relative '../memcached_helper'
2
2
 
3
- describe 'adapter_activesupportcache_with_default_expires', adapter: :ActiveSupportCache do
3
+ describe 'adapter_activesupportcache_with_default_expires', adapter: :ActiveSupportCache, broken: ::Gem::Version.new(RUBY_ENGINE_VERSION) >= ::Gem::Version.new('3.0.0') do
4
4
  before :all do
5
5
  require 'active_support'
6
6
  require 'active_support/cache/moneta_store'
@@ -1,4 +1,4 @@
1
- describe 'standard_activesupportcache' do
1
+ describe 'standard_activesupportcache', adapter: :ActiveSupportCache, broken: ::Gem::Version.new(RUBY_ENGINE_VERSION) >= ::Gem::Version.new('3.0.0') do
2
2
  before :context do
3
3
  require 'active_support'
4
4
  end
@@ -6,9 +6,13 @@ describe 'adapter_datamapper', unsupported: defined?(JRUBY_VERSION) || RUBY_ENGI
6
6
  DataMapper.setup(:default, adapter: :in_memory)
7
7
  end
8
8
 
9
+ let :database_uri do
10
+ "mysql://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{mysql_database1}" + (mysql_socket ? "?socket=#{mysql_socket}" : "")
11
+ end
12
+
9
13
  moneta_build do
10
14
  Moneta::Adapters::DataMapper.new(
11
- setup: "mysql://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{mysql_database1}",
15
+ setup: database_uri,
12
16
  table: "adapter_datamapper"
13
17
  )
14
18
  end
@@ -17,14 +21,14 @@ describe 'adapter_datamapper', unsupported: defined?(JRUBY_VERSION) || RUBY_ENGI
17
21
 
18
22
  it 'does not cross contaminate when storing' do
19
23
  first = Moneta::Adapters::DataMapper.new(
20
- setup: "mysql://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{mysql_database1}",
24
+ setup: database_uri,
21
25
  table: "datamapper_first"
22
26
  )
23
27
  first.clear
24
28
 
25
29
  second = Moneta::Adapters::DataMapper.new(
26
30
  repository: :sample,
27
- setup: "mysql://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{mysql_database1}",
31
+ setup: database_uri,
28
32
  table: "datamapper_second"
29
33
  )
30
34
  second.clear
@@ -38,14 +42,14 @@ describe 'adapter_datamapper', unsupported: defined?(JRUBY_VERSION) || RUBY_ENGI
38
42
 
39
43
  it 'does not cross contaminate when deleting' do
40
44
  first = Moneta::Adapters::DataMapper.new(
41
- setup: "mysql://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{mysql_database1}",
45
+ setup: database_uri,
42
46
  table: "datamapper_first"
43
47
  )
44
48
  first.clear
45
49
 
46
50
  second = Moneta::Adapters::DataMapper.new(
47
51
  repository: :sample,
48
- setup: "mysql://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{mysql_database1}",
52
+ setup: database_uri,
49
53
  table: "datamapper_second"
50
54
  )
51
55
  second.clear
@@ -8,7 +8,7 @@ describe "standard_datamapper", unsupported: defined?(JRUBY_VERSION) || RUBY_ENG
8
8
 
9
9
  moneta_store :DataMapper do
10
10
  {
11
- setup: "mysql://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{mysql_database1}",
11
+ setup: "mysql://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{mysql_database1}" + (mysql_socket ? "?socket=#{mysql_socket}" : ""),
12
12
  table: "simple_datamapper"
13
13
  }
14
14
  end
@@ -12,7 +12,7 @@ describe "standard_datamapper_with_expires", unsupported: defined?(JRUBY_VERSION
12
12
 
13
13
  moneta_store :DataMapper do
14
14
  {
15
- setup: "mysql://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{mysql_database1}",
15
+ setup: "mysql://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{mysql_database1}" + (mysql_socket ? "?socket=#{mysql_socket}" : ""),
16
16
  table: "simple_datamapper_with_expires",
17
17
  expires: true
18
18
  }
@@ -9,7 +9,7 @@ describe 'standard_datamapper_with_repository', unsupported: defined?(JRUBY_VERS
9
9
  moneta_store :DataMapper do
10
10
  {
11
11
  repository: :repo,
12
- setup: "mysql://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{mysql_database1}",
12
+ setup: "mysql://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{mysql_database1}" + (mysql_socket ? "?socket=#{mysql_socket}" : ""),
13
13
  table: "simple_datamapper_with_repository"
14
14
  }
15
15
  end
@@ -1,4 +1,9 @@
1
1
  describe 'standard_null', adapter: :Null do
2
2
  moneta_store :Null
3
3
  moneta_specs STANDARD_SPECS.without_increment.without_create.without_store.without_persist
4
+
5
+ it 'works when constructed with a proxy object' do
6
+ store = Moneta.new(:Null, expires: 1)
7
+ expect { store['moneta'] = 'test' }.not_to raise_error
8
+ end
4
9
  end
@@ -4,9 +4,12 @@ RSpec.shared_context :sequel do
4
4
  if defined?(JRUBY_VERSION)
5
5
  uri = "jdbc:mysql://#{mysql_host}:#{mysql_port}/#{database}?user=#{mysql_username}&useSSL=false"
6
6
  uri += "&password=#{mysql_password}" if mysql_password
7
+ uri += "&socket=#{mysql_socket}" if mysql_socket
7
8
  uri
8
9
  else
9
- "mysql2://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{database}"
10
+ uri = "mysql2://#{mysql_username}:#{mysql_password}@#{mysql_host}:#{mysql_port}/#{database}"
11
+ uri += "?socket=#{mysql_socket}" if mysql_socket
12
+ uri
10
13
  end
11
14
  end
12
15
 
@@ -24,7 +24,7 @@ class MonetaStoreTest < ActionDispatch::IntegrationTest
24
24
  end
25
25
 
26
26
  def get_session_id
27
- render plain: "#{request.cookies['_session_id']}"
27
+ render plain: request.cookies['_session_id'].to_s
28
28
  end
29
29
 
30
30
  def call_reset_session
@@ -60,13 +60,13 @@ class MonetaStoreTest < ActionDispatch::IntegrationTest
60
60
  get '/set_session_value'
61
61
  assert_response :success
62
62
  assert cookies['_session_id']
63
- session_cookie = cookies.send(:hash_for)['_session_id']
63
+ session_cookie = cookies.to_hash['_session_id']
64
64
 
65
65
  get '/call_reset_session'
66
66
  assert_response :success
67
67
  assert_not_equal [], headers['Set-Cookie']
68
68
 
69
- cookies << session_cookie # replace our new session_id with our old, pre-reset session_id
69
+ cookies.merge(session_cookie) # replace our new session_id with our old, pre-reset session_id
70
70
 
71
71
  get '/get_session_value'
72
72
  assert_response :success
@@ -157,7 +157,7 @@ class MonetaStoreTest < ActionDispatch::IntegrationTest
157
157
 
158
158
  reset!
159
159
 
160
- get '/set_session_value', params: {_session_id: session_id}
160
+ get "/set_session_value?_session_id=#{session_id}"
161
161
  assert_response :success
162
162
  assert_not_equal session_id, cookies['_session_id']
163
163
  end
@@ -174,7 +174,7 @@ class MonetaStoreTest < ActionDispatch::IntegrationTest
174
174
  ActiveSupport::Dependencies.autoload_paths << path
175
175
  yield
176
176
  ensure
177
- ActiveSupport::Dependencies.autoload_paths.reject! {|p| p == path}
177
+ ActiveSupport::Dependencies.autoload_paths.reject! { |p| p == path }
178
178
  ActiveSupport::Dependencies.clear
179
179
  end
180
180
  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.5.1
4
+ version: 1.5.2
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: 2022-04-13 00:00:00.000000000 Z
14
+ date: 2022-11-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: multi_json
@@ -446,9 +446,9 @@ licenses:
446
446
  - MIT
447
447
  metadata:
448
448
  bug_tracker_uri: https://github.com/moneta-rb/moneta/issues
449
- changelog_uri: https://github.com/moneta-rb/moneta/blob/v1.5.1/CHANGES
450
- documentation_uri: https://www.rubydoc.info/gems/moneta/1.5.1
451
- source_code_uri: https://github.com/moneta-rb/moneta/tree/v1.5.1
449
+ changelog_uri: https://github.com/moneta-rb/moneta/blob/v1.5.2/CHANGES
450
+ documentation_uri: https://www.rubydoc.info/gems/moneta/1.5.2
451
+ source_code_uri: https://github.com/moneta-rb/moneta/tree/v1.5.2
452
452
  post_install_message:
453
453
  rdoc_options: []
454
454
  require_paths:
@@ -464,7 +464,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
464
464
  - !ruby/object:Gem::Version
465
465
  version: '0'
466
466
  requirements: []
467
- rubygems_version: 3.2.29
467
+ rubygems_version: 3.3.25
468
468
  signing_key:
469
469
  specification_version: 4
470
470
  summary: A unified interface to key/value stores, including Redis, Memcached, TokyoCabinet,