Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Ruby 3.3 Range#overlap? if available #49317

Merged
merged 1 commit into from
Sep 19, 2023

Commits on Sep 19, 2023

  1. Use Ruby 3.3 Range#overlap? if available

    This commit uses Ruby 3.3 `Range#overlap?` that has been added to Ruby via ruby/ruby#8242 .
    Rails 7.1 renames `Range#overlaps?` to `Range#overlap?` via rails#48565 ,
    This commit is not feasible to backport because there is no `Range#overlap?` in Rails 7.0.z
    
    This commit addresses the CI faiilure at https://buildkite.com/rails/rails/builds/99745#018a9ea8-82f0-40a6-90c3-cdaa6dabebab/1092-1095
    because without this commit, it shows `warning: method redefined; discarding old overlap?`.
    ```ruby
    $ ruby -v
    ruby 3.3.0dev (2023-09-16T05:57:19Z master e9b503f1bb) [x86_64-linux]
    $ RAILS_STRICT_WARNING=true bundle exec ruby -w -Itest test/core_ext/range_ext_test.rb
    /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/core_ext/range/overlap.rb:7: warning: method redefined; discarding old overlap?
    Running 46 tests in a single process (parallelization threshold is 50)
    Run options: --seed 583
    
    \# Running:
    
    ..............................................
    
    Finished in 0.011672s, 3940.9670 runs/s, 4883.3722 assertions/s.
    46 runs, 57 assertions, 0 failures, 0 errors, 0 skips
    ```
    yahonda committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    1d76d45 View commit details
    Browse the repository at this point in the history