avdi / naught

A toolkit for building Null Object classes in Ruby
MIT License
1.05k stars 53 forks source link

Ruby 2.4 does not like `Naught.build(&:black_hole)` form #70

Open tjchambers opened 7 years ago

tjchambers commented 7 years ago

I am in the process of updating an app to Ruby 2.4.0.

I found I needed to use:

NullBeaneater = Naught.build do |config|
  config.black_hole
end

form in place of the shorthand above.

I don't understand why specifically.

eugeneius commented 7 years ago

This is a regression in Ruby 2.4.0: https://bugs.ruby-lang.org/issues/13074

The fix has been backported to the 2.4 branch, so it should be fixed in 2.4.1.