Skip to content

🐛 Properly handle XPathParser#document, Child#document # => nil #261

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

Closed

Conversation

pboling
Copy link
Contributor

@pboling pboling commented Jul 7, 2025

➜  bundle exec rake test
/var/home/pboling/.local/share/mise/installs/ruby/3.4.3/bin/ruby test/run.rb
Loaded suite test
Started
Finished in 3.732624789 seconds.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
712 tests, 2165 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
190.75 tests/s, 580.02 assertions/s

@pboling pboling changed the title 🐛 Properly handle Element#document # => nil 🐛 Properly handle XPathParser#document, Child#document # => nil Jul 7, 2025
@pboling pboling force-pushed the bug/260-element.document_nil_handling branch from 047dcbf to fa8e3db Compare July 7, 2025 22:26
pboling added a commit to ruby-openid/ruby-openid2 that referenced this pull request Jul 7, 2025
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you split this PR to logically separated PRs?

For example:

  • Refactoring by &. (This must not change the current behavior)
  • Caching retrieved doctype in a local variable (This must not change the current behavior)
  • Removing redundant return (This must not change the current behavior)
  • Reusing XPath.match (This must not change the current behavior)
  • Changing XPath.match behavior
  • Adding support for Elements#each without document

@pboling
Copy link
Contributor Author

pboling commented Jul 8, 2025

Sure!

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.

XPath.parse should always return array NoMethodError: undefined method 'enable_cache' for nil
2 participants