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

Add gem.last_initializer #6212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dearblue
Copy link
Contributor

Provides a mechanism for the GEM author to do the final processing after the blocks specified in build.gem have been processed.

This allows GEM author and user code to be processed in the following order:

  1. The block passed to MRuby::Gem::Specification.new in mrbgem.rake
  2. The block passed to MRuby::Build#gem in the build configuration file.
  3. The block passed to MRuby::Gem::Specification#last_initializer in MRuby::Gem::Specification.new.

When performing library detection, I would like to use it to auto-detect when GEM users do not specify anything.
https://github.com/dearblue/mruby-stacktrace/blob/TENTATIVE.1/mrbgem.rake#L123-L144

So far, if desired to specify a block for default settings, this can be accomplished by directly assigning it to an instance variable.
However, when viewed as a public API, I do not believe this is the preferred method.
https://github.com/dearblue/mruby-stacktrace/blob/TENTATIVE.1/mrbgem.rake#L117

Provides a mechanism for the GEM author to do the final processing after the blocks specified in `build.gem` have been processed.

This allows GEM author and user code to be processed in the following order:

 1. The block passed to `MRuby::Gem::Specification.new` in `mrbgem.rake`
 2. The block passed to `MRuby::Build#gem` in the build configuration file.
 3. The block passed to `MRuby::Gem::Specification#last_initializer` in `MRuby::Gem::Specification.new`.
@dearblue dearblue requested a review from matz as a code owner March 21, 2024 13:21
@github-actions github-actions bot added the build label Mar 21, 2024
@matz
Copy link
Member

matz commented Mar 26, 2024

Thank you for the proposal, however, I don't think the name last_initializer is appropriate, since it does not describe the true purpose of this initializer. Any idea (especially for English speakers)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants