Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 54 lines (43 sloc) 1.074 kb
accd9b4 @josh Restore "Start Rails::Application object
josh authored
1 module Rails
2 class Application
6d6ae08 Start moving the initializers into the application object
Carl Lerche authored
3 extend Initializable
4
5 def self.inherited(child)
6 child.initializers = initializers.dup
7 end
6f6a589 Create the application object from config/environment.rb
Yehuda Katz + Carl Lerche authored
8
c9d4529 Change Rails::Application to a class that is inherited from.
Carl Lerche authored
9 def self.config
10 @config ||= Configuration.new
11 end
12
13 def self.config=(config)
14 @config = config
15 end
16
6d6ae08 Start moving the initializers into the application object
Carl Lerche authored
17 def self.routes
6b08644 Fix the broken railties isolation tests
Carl Lerche authored
18 ActionController::Routing::Routes
accd9b4 @josh Restore "Start Rails::Application object
josh authored
19 end
20
6d6ae08 Start moving the initializers into the application object
Carl Lerche authored
21 def self.middleware
6f6a589 Create the application object from config/environment.rb
Yehuda Katz + Carl Lerche authored
22 config.middleware
23 end
24
6d6ae08 Start moving the initializers into the application object
Carl Lerche authored
25 def self.call(env)
c9d4529 Change Rails::Application to a class that is inherited from.
Carl Lerche authored
26 @app ||= middleware.build(routes)
accd9b4 @josh Restore "Start Rails::Application object
josh authored
27 @app.call(env)
28 end
6d6ae08 Start moving the initializers into the application object
Carl Lerche authored
29
30 def self.new
31 initializers.run
32 self
33 end
34
35 initializer :initialize_rails do
36 Rails.initializers.run
37 end
38
39 # Set the <tt>$LOAD_PATH</tt> based on the value of
40 # Configuration#load_paths. Duplicates are removed.
41 initializer :set_load_path do
42 config.paths.add_to_load_path
43 $LOAD_PATH.uniq!
44 end
45
46 # Bail if boot.rb is outdated
47 initializer :freak_out_if_boot_rb_is_outdated do
48 unless defined?(Rails::BOOTSTRAP_VERSION)
49 abort %{Your config/boot.rb is outdated: Run "rake rails:update".}
50 end
51 end
accd9b4 @josh Restore "Start Rails::Application object
josh authored
52 end
53 end
Something went wrong with that request. Please try again.