Closed chrisseaton closed 2 years ago
Seems like it was only added as some kind of workaround?
https://github.com/ruby-concurrency/concurrent-ruby/commit/714d9196850c7157297975e2c88db5cc4fd881e0
Not sure how we ended up with two ways to do the same thing. One would be better.
https://github.com/ruby-concurrency/concurrent-ruby/pull/709 seems a valuable feature, and breaking Bundler.require
is probably unacceptable for Rails or other projects with concurrent-ruby in the Gemfile and using Bundler.require
.
And it's still needed for Bundler.require
:
source 'https://rubygems.org'
gem 'concurrent-ruby'
$ bundle
$ bundle exec ruby -e 'Bundler.require; puts $"' | grep concurrent-ruby
...
/home/eregon/.rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent.rb
/home/eregon/.rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/concurrent-ruby-1.1.9/lib/concurrent-ruby/concurrent-ruby.rb
If I remove concurrent-ruby.rb
:
$ bundle exec ruby -de 'p Bundler.require; p Concurrent'
-e:1:in `<main>': uninitialized constant Concurrent (NameError)
So maybe the only missing thing here is a test for require 'concurrent-ruby'
.
I'm not sure it's worth the trouble, this seems used by several gems, and the name of this gem kind of implies
require 'concurrent-ruby'
should work. Also the cost to keep this seems close to zero. I personally feel weird every time I seerequire 'concurrent'
.