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

Update bin/readability to work with Ruby 3.x #100

Merged

Conversation

apainintheneck
Copy link
Contributor

These changes should be backwards compatible with older Ruby versions according to the docs and testing it on Ruby 2.7 and 3.2.

Changes:

  1. Use require_relative to avoid loading errors.
  2. Use URI.parse(...).read instead of open(...).read

Do you think it's worth adding an integration test for this on CI?

Something like this would probably work to sanity check this. Probably would need to add more Rubies to CI though to make it a better check. Maybe not worth the effort.

bin/readability https://github.com/cantino/ruby-readability

These changes should be backwards compatible with older Ruby versions
according to the docs and testing it on Ruby 2.7.

Changes:
1. Use `require_relative` to avoid loading errors.
2. Use `URI.parse(...).read` instead of `open(...).read`
    - This seems to be backwards compatible with older Ruby versions.
        - Ex. https://www.rubydoc.info/stdlib/open-uri/2.3.1/OpenURI
    - The behavior should be identical to what we saw before.
    - `open(...).read` got deprecated in Ruby 3.0
@cantino cantino merged commit aaca620 into cantino:master Nov 23, 2024
1 check passed
@cantino
Copy link
Owner

cantino commented Nov 23, 2024

Thanks @apainintheneck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants