diff options
Diffstat (limited to 'railties/lib/rails/core.rb')
-rw-r--r-- | railties/lib/rails/core.rb | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/railties/lib/rails/core.rb b/railties/lib/rails/core.rb index 929c38bd22..a5e51ad04a 100644 --- a/railties/lib/rails/core.rb +++ b/railties/lib/rails/core.rb @@ -6,7 +6,7 @@ module Rails # TODO: w0t? class << self def application - @@application + @@application ||= nil end def application=(application) @@ -18,6 +18,10 @@ module Rails application.configuration end + def initialize! + application.initialize! + end + def initialized? @initialized || false end @@ -43,7 +47,7 @@ module Rails end def root - Pathname.new(RAILS_ROOT) if defined?(RAILS_ROOT) + application && application.config.root end def env @@ -66,36 +70,4 @@ module Rails @@public_path = path end end - - class OrderedOptions < Array #:nodoc: - def []=(key, value) - key = key.to_sym - - if pair = find_pair(key) - pair.pop - pair << value - else - self << [key, value] - end - end - - def [](key) - pair = find_pair(key.to_sym) - pair ? pair.last : nil - end - - def method_missing(name, *args) - if name.to_s =~ /(.*)=$/ - self[$1.to_sym] = args.first - else - self[name] - end - end - - private - def find_pair(key) - self.each { |i| return i if i.first == key } - return false - end - end end
\ No newline at end of file |