aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/initializers/initializers_command.rb
blob: 33596177afc1649f8aa022609d7ce033d9f59ec7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

module Rails
  module Command
    class InitializersCommand < Base # :nodoc:
      desc "initializers", "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|
          say "#{initializer.context_class}.#{initializer.name}"
        end
      end
    end
  end
end