Created
February 24, 2017 09:30
-
-
Save the-teacher/ec1b3560916ceae0c5fb5c819ac85438 to your computer and use it in GitHub Desktop.
rails pront initializers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module TheApp | |
class Application < Rails::Application | |
def initializers | |
bootstrap = Bootstrap.initializers_for(self) | |
railties = super | |
finisher = Finisher.initializers_for(self) | |
if Rails.env.development? | |
print_initializers(bootstrap, "#BOOTSTRAP") | |
print_initializers(railties, "#RAILTIES") | |
print_initializers(finisher, "#FINISHER") | |
end | |
bootstrap + railties + finisher | |
end | |
def print_initializers(initializers, stage) | |
puts stage.red | |
initializers.each do |i| | |
puts i.name =~ /relic/ ? i.name.yellow : i.name | |
end | |
end | |
end | |
ned |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment