aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/initializer.rb
blob: f7c3774450ce38126b4f01517238cdef338166ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require "pathname"

require 'rails/initializable'
require 'rails/application'
require 'rails/railties_path'
require 'rails/version'
require 'rails/gem_dependency'
require 'rails/rack'
require 'rails/paths'
require 'rails/core'
require 'rails/configuration'

RAILS_ENV = (ENV['RAILS_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?
        Rails.application.new
      end
    end
  end
end