moneta-rb / moneta

a unified interface to key/value stores
https://github.com/moneta-rb/moneta
MIT License
1.11k stars 87 forks source link

Error: "wrong number of arguments" in v1.5.0 #222

Closed DannyBen closed 2 years ago

DannyBen commented 2 years ago

It seems like something is broken in 1.5.0.

Running the simplest example from the README:

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'
  gem 'moneta', '1.5.0'      # FAILS
  # gem 'moneta', '1.4.2'    # works
end

store = Moneta.new(:File, dir: 'moneta')

fails with `configure': wrong number of arguments (given 1, expected 0) (ArgumentError)

/home/vagrant/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/moneta-1.5.0/lib/moneta/config.rb:69:in `configure': wrong number of arguments (given 1, expected 0) (ArgumentError)
        from /home/vagrant/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/moneta-1.5.0/lib/moneta/adapters/file.rb:19:in `initialize'
        from /home/vagrant/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/moneta-1.5.0/lib/moneta.rb:144:in `new'
        from /home/vagrant/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/moneta-1.5.0/lib/moneta.rb:144:in `new'
        from test.rb:9:in `<main>'

When pinning to 1.4.2, it works.

asppsa commented 2 years ago

Hi, thanks for the report. This issue is actually already fixed in main - I'll make a patch release ASAP with the fix.

Please note that Ruby 3.x support is still patchy. It seems like most things work, but some adapters are failing in CI at present.

asppsa commented 2 years ago

I've just done a 1.5.1 release with the fix - if you're still seeing issues with the File adapter, please re-open the ticket.