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

Remove the explicit superclass from monkey-patch #1472

Merged
merged 1 commit into from
Mar 4, 2022
Merged

Remove the explicit superclass from monkey-patch #1472

merged 1 commit into from
Mar 4, 2022

Conversation

cjcolvar
Copy link
Member

@cjcolvar cjcolvar commented Mar 4, 2022

Fixes #1466 an d #1471

This allows the monkey-patch to work with either rdf <= 3.2.4 or rdf >= 3.2.5
The monkey-patch is necessary to maintain the current behavior of nanosecond precision in dates
Failing tests in hyrax revealed this so tests were added here to test this functionality

Note that rdf 3.2.0+ require ruby >= 2.6 so the ruby 2.5 circleci builds should be testing with rdf < 3.2.5 while the ruby 2.6 and 2.7 builds should be testing with rdf = 3.2.5.

This allows the monkey-patch to work with either rdf <= 3.2.4 or rdf >= 3.2.5
The monkey-patch is necessary to maintain the current behavior of nanosecond precision in dates
Failing tests in hyrax revealed this so tests were added here to test this functionality
Copy link
Contributor

@elrayle elrayle left a comment

Choose a reason for hiding this comment

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

Thanks for getting this to work!

it 'time zone must have semicolin to be a cannonical XMLSchema#dateTime' do
expect(triple.to_s).to match(/\+01:00/)
end

context 'nanoseconds' do
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice coverage of possible conditions.

# TODO: Figure out how to contribute something upstream to avoid monkey-patching
module RDF
class Literal
class DateTime
Copy link
Contributor

Choose a reason for hiding this comment

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

Glad to see the suggestion to remove < Literal worked.

@cjcolvar
Copy link
Member Author

cjcolvar commented Mar 4, 2022

I'm running hyrax's tests against this branch: samvera/hyrax#5495

@cjcolvar
Copy link
Member Author

cjcolvar commented Mar 4, 2022

All of Hyrax's tests passed and I verified that the build was using rdf 3.2.5 for the ruby 2.6 and 2.7 builds and rdf < 3.2 for the ruby 2.5 build.

@cjcolvar cjcolvar merged commit cc3fd88 into main Mar 4, 2022
@cjcolvar cjcolvar deleted the no_super branch March 4, 2022 20:52
@cjcolvar cjcolvar mentioned this pull request Mar 4, 2022
@cjcolvar
Copy link
Member Author

cjcolvar commented Mar 4, 2022

Sorry, this doesn't fix #1471 quite yet, but when this gets into a release I'll work on backporting it and doing a 12.x release.

This was referenced Mar 4, 2022
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.

rdf 3.2.5 causes superclass mismatch for class DateTime
2 participants