Skip to content

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

Merged
flavorjones merged 10 commits intomainfrom
flavorjones-kwarg-doc-and-docfrag
Dec 8, 2024
Merged

{XML,HTML4,HTML5}::{Document,DocumentFragment}{.parse,#initialize} take keyword arguments#3355
flavorjones merged 10 commits intomainfrom
flavorjones-kwarg-doc-and-docfrag

Conversation

@flavorjones
Copy link
Copy Markdown
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 and others added 9 commits December 8, 2024 10:44
Related to #3323

This commit was merged and expanded from #3336, thank you @MattJones!

Co-authored-by: Matt Jones <matthew.hartley.jones@gmail.com>
Related to #3323

This commit was merged and expanded from #3335, thank you @infews!

Co-authored-by: Davis W. Frank <dwfrank@gmail.com>
and improve the documentation

Part of #3323
@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
@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