Skip to content

Instantly share code, notes, and snippets.

@the-teacher
Created February 24, 2017 09:30
Show Gist options
  • Save the-teacher/ec1b3560916ceae0c5fb5c819ac85438 to your computer and use it in GitHub Desktop.
Save the-teacher/ec1b3560916ceae0c5fb5c819ac85438 to your computer and use it in GitHub Desktop.
rails pront initializers
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