Skip to content

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

Closed
pboling wants to merge 2 commits intoruby:masterfrom
pboling:bug/260-element.document_nil_handling
Closed

🐛 Properly handle XPathParser#document, Child#document # => nil#261
pboling wants to merge 2 commits intoruby:masterfrom
pboling:bug/260-element.document_nil_handling

Conversation

@pboling
Copy link
Copy Markdown

@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

Copy link
Copy Markdown
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
Copy Markdown
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