marcandre / backports

The latest features of Ruby backported to older versions.
MIT License
436 stars 52 forks source link

Range#cover? accepts a Range after 2.6 #145

Closed headius closed 4 years ago

headius commented 4 years ago

Range#cover? accepts a Range object in 2.6 and higher.

This is not currently implemented in backports.

marcandre commented 4 years ago

Oh, thanks, I'm on it :-)

headius commented 4 years ago

We make a checklist out of NEWS for each Ruby version... Here is the JRuby issue for 2.6: https://github.com/jruby/jruby/pull/6037

The specs also show a bunch of other Range behaviors not explicitly called out in NEWS, mostly regarding endless ranges (hard to support in backports since it requires parser changes).

FWIW I swiped your Proc/Method #<< and #>> today and still ship a version of Lazy I think you wrote 😃 Many new features are fine for us in pure Ruby (we can go native later if perf demands it) so if you ever feel like adding missing features...

headius commented 4 years ago

Oops that should have been jruby/jruby#5576

marcandre commented 4 years ago

Right, I'm adding some missing Rubyspecs for endless ranges...

In theory Endless ranges could be written without parser changes (as Range.new(1, nil)) but would be still not be quite supportable.

marcandre commented 4 years ago

Done and released (but forgot to close this 😆)