aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application.rb
blob: c70365e2f82f0d69d4d68a44486eb9283892f5b5 (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
module Rails
  class Application
    attr_accessor :config

    def self.load(environment_file)
      environment = File.read(environment_file)
      Object.class_eval(environment, environment_file)
    end

    def routes
      ActionController::Routing::Routes
    end

    def middleware
      config.middleware
    end

    def call(env)
      @app ||= middleware.build(@routes)
      @app.call(env)
    end
  end
end