diff options
author | Annie-Claude Côté <hello@annie.codes> | 2018-08-16 10:13:58 -0400 |
---|---|---|
committer | Annie-Claude Côté <hello@annie.codes> | 2018-08-16 10:46:11 -0400 |
commit | 1ce2f9a55c21873f334e0c3cbc70e1b56f442442 (patch) | |
tree | aebde51442de2c4b9b0807e8bfffe69990c3b395 /railties/lib/rails/commands | |
parent | ccdb23d500b87dd2580ef0dde5052c842e59de00 (diff) | |
download | rails-1ce2f9a55c21873f334e0c3cbc70e1b56f442442.tar.gz rails-1ce2f9a55c21873f334e0c3cbc70e1b56f442442.tar.bz2 rails-1ce2f9a55c21873f334e0c3cbc70e1b56f442442.zip |
Move 'rails initializers' command to Rails::Command
Diffstat (limited to 'railties/lib/rails/commands')
-rw-r--r-- | railties/lib/rails/commands/initializers/initializers_command.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/railties/lib/rails/commands/initializers/initializers_command.rb b/railties/lib/rails/commands/initializers/initializers_command.rb new file mode 100644 index 0000000000..6ed50f207a --- /dev/null +++ b/railties/lib/rails/commands/initializers/initializers_command.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Rails + module Command + class InitializersCommand < Base # :nodoc: + desc "Print out all defined initializers in the order they are invoked by Rails." + def perform + require_application_and_environment! + + Rails.application.initializers.tsort_each do |initializer| + puts "#{initializer.context_class}.#{initializer.name}" + end + end + end + end +end |