aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/initializer.rb
blob: 44101dcc948526438808a927822335b16097527e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require "rails" # In case people require this file directly

RAILS_ENV = (ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development').dup unless defined?(RAILS_ENV)

module Rails
  class Initializer
    class Error < StandardError ; end
    def self.run(initializer = nil, config = nil)
      if initializer
        # Deprecated
      else
        Rails.application = Class.new(Application)
        yield Rails.application.config if block_given?
      end
    end
  end
end