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

{XML,HTML4,HTML5}::{Document,DocumentFragment}{.parse,#initialize} take keyword arguments #3355

Merged
merged 10 commits into from
Dec 8, 2024

Conversation

flavorjones
Copy link
Member

@flavorjones flavorjones commented Dec 8, 2024

What problem is this PR intended to solve?

As part of #3323 there were a few RubyConf 2024 Hack Day pull requests addressing Document and DocumentFragment constructors which were related to, or blocked on, some changes to the C code.

So this PR is a mega-PR that merges all those PRs and unifies the code and doc style:

But in addition to those PRs also updates:

  • the XML::DocumentFragment new/initialize argument handling for CRuby and JRuby
  • XML::DocumentFragment#initialize kwargs
  • HTML4::Document.parse kwargs
  • general improvement of documentation

Have you included adequate test coverage?

I think so!

Does this change affect the behavior of either the C or the Java implementations?

The XML::DocumentFragment allocator has changed, but both implementations have been updated.

Using `...` in Ruby is so much easier (and more efficient) than the
equivalent code written in the C extension, and allows us to introduce
very flexible initializer parameters (like kwargs).
@flavorjones flavorjones force-pushed the flavorjones-kwarg-doc-and-docfrag branch from 2da0c10 to ac9fb8a Compare December 8, 2024 15:44
@flavorjones flavorjones marked this pull request as ready for review December 8, 2024 15:48
@flavorjones flavorjones enabled auto-merge December 8, 2024 15:48
@flavorjones flavorjones merged commit 92d2e4b into main Dec 8, 2024
132 of 133 checks passed
@flavorjones flavorjones deleted the flavorjones-kwarg-doc-and-docfrag branch December 8, 2024 16:10
@flavorjones flavorjones added the event/hackday2024 RubyConf 2024 Hack Day label Dec 8, 2024
@flavorjones flavorjones added this to the v1.17.0 milestone Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event/hackday2024 RubyConf 2024 Hack Day
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants