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

Centralize generator setup #1302

Merged
merged 1 commit into from
Mar 2, 2025
Merged

Centralize generator setup #1302

merged 1 commit into from
Mar 2, 2025

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Mar 2, 2025

Discovered when working on #1300

Currently we need to call setup in individual generation methods, despite having already called it in RDoc#generate. This is because setup is lazily called when we run ri's server mode.

By calling setup eagerly in Servlet#generator_for, we can avoid the repeated calls to setup in individual generation methods.

Right now we can NOT move setup into Darkfish#initialize yet because ri's server can initialize Darkfish with nil store.

Currently we need to call `setup` in individual generation methods,
despite having already called it in `RDoc#generate`.

This is because `setup` is lazily called when we run `ri`'s server
mode.

By calling `setup` eagerly in `Servlet#generator_for`, we can
avoid the repeated calls to `setup` in individual generation methods.
Copy link
Collaborator

@flavorjones flavorjones left a comment

Choose a reason for hiding this comment

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

I think this is a good incremental improvement.

@st0012 st0012 merged commit 20d71f1 into master Mar 2, 2025
52 checks passed
@st0012 st0012 deleted the refactor-generator-setup branch March 2, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants