Replies: 1 comment 3 replies
-
@sandstrom I think the upcoming Initializers feature of 1.2 will fit the bill of what you're asking. https://edge.bridgetownrb.com/docs/configuration/initializers And you're right, using a builder to customize a gem isn't ideal, but prior to initializers we didn't really have a good alternative. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having some trouble adding custom directories to the load path.
Specifically, I'd like to add
lib/
to load path, because I havelib/utils/misc.rb
that I want to load.Maybe we should add a
boot.rb
file. It could be empty by default, or possibly call some simple setup function on Bridgetown (such asBridgetown.begin!
or a newBrigetown.setup!
). That way, there would be a known place to stick stuff that should execute very early.This is what Rails have in
environment.rb
(I don't like that filename though):This could be a good place for e.g. making modifications to other gems early, for example this modification we did to
I18n
(we put it in a builder, but that's not really the right place). See #598 (comment)I'm sure there are other users too. Basically a low-level hook, in the form of a user-controlled file (part of default file structure, checked into version control, but modifiable by the user).
Beta Was this translation helpful? Give feedback.
All reactions