browser icon indicating copy to clipboard operation
browser copied to clipboard

Ruby version requirement change in 6.0.0?

Open mjankowski opened this issue 1 year ago • 1 comments

Just saw the 6.0.0 release -- nice, thanks!

Curious about this ruby version req change - https://github.com/fnando/browser/commit/e54203b13995b4cc6199b521e430427a95ab4579#diff-53ec28e04e87eace119c08cf1afa508aa03532493a9e256ed8ddcd2fd0c72423R15 - I think ruby 3.0 was recently EOL'd but ruby 3.1 is still supported for another ~year or so ... https://www.ruby-lang.org/en/downloads/branches/

Was there a rubocop requirement or other ruby style thing somewhere in the recent changes that merited bumping all the way up to 3.2 minimum, or could 3.1 have been kept? Would like to bump the browser gem dep, but still have some legacy 3.1 installs to support.

(I originally left this as a comment on a commit, but realized that may not be super visible. Sorry about the effective double posting...)

mjankowski avatar May 01 '24 12:05 mjankowski

I also ran into this issue. I'm using Debian stable and they are at Ruby 3.1. Dropping the 3.1 seems a little to soon?

johan-smits avatar Jul 09 '24 14:07 johan-smits

To solve this I added the following backport monkey patch to my application

config/initializers/browser_monkey_patches.rb

if Browser::VERSION.to_f < 6.0
  Browser::Base.class_eval do
    def chromium_based?
      false
    end
  end

  Browser::Chrome.class_eval do
    def chromium_based?
      true
    end
  end

  Browser::Edge.class_eval do
    def chromium_based?
      match? && ua.match?(/\bEdg\b/)
    end
  end
end

westonganger avatar Dec 03 '24 23:12 westonganger

It would be preferable to cut a new gem point release which doesnt limit the Ruby version so aggressively. Would be easy to do.

westonganger avatar Dec 04 '24 00:12 westonganger

Closing this on assumption that there was a year mixup (3.1 is EOL in April 2025, but presumably maintainer read that as 2024?)

In ~4 months, this will be retroactively correct.

mjankowski avatar Dec 04 '24 16:12 mjankowski