Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove dependency on ostruct #2535

Closed
mojavelinux opened this issue Sep 5, 2024 · 2 comments
Closed

Remove dependency on ostruct #2535

mojavelinux opened this issue Sep 5, 2024 · 2 comments
Assignees
Milestone

Comments

@mojavelinux
Copy link
Member

The ostruct library is being repackaged as a gem and removed from Ruby's standard library (stdlib). Replace OpenStruct with an internal implementation to avoid this whole mess. The custom class should be named Asciidoctor::PDF::ThemeData since the only use of OpenStruct in Asciidoctor PDF is for the theme data. This also gives us the opportunity to optimize this object for more efficient access in the future.

@mojavelinux mojavelinux added this to the v2.3.x milestone Sep 5, 2024
@mojavelinux mojavelinux self-assigned this Sep 5, 2024
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 5, 2024
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 6, 2024
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Sep 7, 2024
@mojavelinux
Copy link
Member Author

As part of this fix, json 2.7.2 also has to be installed (since json 2.7.1 uses ostruct). Normally, it gets added by rubocop. However, if lint is not enabled, it needs to be installed for simplecov/deep-cover. So if Ruby is > 3.3.4, add json as a coverage dependency. logger is also being removed from stdlib, so for now, it needs to be declared as a dependency in the Gemfile if Ruby > 3.3.4.

@mojavelinux
Copy link
Member Author

To be clear, this doesn't solve the entire probably being introduced by Ruby's continued gemfication of APIs previously in stdlib. But it at least solves the direct dependency that Asciidoctor PDF has on the APIs being removed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant