Skip to content

Ruby 4.0 compatibility, contributor handling, and citation output fixes#229

Merged
kaysiz merged 28 commits into
masterfrom
ks-fix-csl
Apr 29, 2026
Merged

Ruby 4.0 compatibility, contributor handling, and citation output fixes#229
kaysiz merged 28 commits into
masterfrom
ks-fix-csl

Conversation

@kaysiz
Copy link
Copy Markdown
Member

@kaysiz kaysiz commented Apr 28, 2026

Purpose

This PR addresses Ruby 4.0 compatibility issues with citeproc/csl-ruby, ensures correct handling of DataCite contributors, and improves citation output logic:

  • Monkey-patches CiteProc::Variable to recognize contributor and accepted-date as valid fields, updating @fields, @types, and @factories.
  • Filters contributors so that only those not already listed as creators, editors, or translators are passed to CiteProc, preventing duplication in citations.
  • Ensures correct citation output for both software and book types, matching CSL style expectations.
  • Adds/updates specs to verify contributor handling for both software and book types.

closes: Add github issue that originated this PR

Approach

  • Fixes "undefined method 'take'" and "undefined method 'personal?'" errors under Ruby 4.0.
  • Ensures contributors like TCCON (ResearchGroup) are only shown in citations when the CSL style and type (e.g., book) support it.
  • For software type, contributors are present in the data but not rendered in APA and most CSL styles (by design).
  • For book type, contributors appear as expected (e.g., "(with TCCON)").
  • Test coverage.

References

Open Questions and Pre-Merge TODOs

Learning

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

@kaysiz kaysiz self-assigned this Apr 28, 2026
@kaysiz kaysiz requested a review from codycooperross April 28, 2026 11:26
@kaysiz kaysiz requested a review from a team April 28, 2026 11:26
@kaysiz kaysiz merged commit c947c3e into master Apr 29, 2026
5 checks passed
@kaysiz kaysiz deleted the ks-fix-csl branch April 29, 2026 05:33
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.

3 participants