diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-10-27 16:46:45 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-10-27 17:01:33 -0700 |
commit | da62a7c5362ee76e8fdc8cb942c4c1eefccfeab0 (patch) | |
tree | 176ea6c4024c4ae590f59f2b6ad03827f7756ff0 /railties | |
parent | c28a45ad8bb72896d84285158e7f5dc728933062 (diff) | |
download | rails-da62a7c5362ee76e8fdc8cb942c4c1eefccfeab0.tar.gz rails-da62a7c5362ee76e8fdc8cb942c4c1eefccfeab0.tar.bz2 rails-da62a7c5362ee76e8fdc8cb942c4c1eefccfeab0.zip |
Duplicate AS code no longer needed
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/configuration.rb | 7 | ||||
-rw-r--r-- | railties/lib/rails/core.rb | 32 |
2 files changed, 4 insertions, 35 deletions
diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index 1a7483c548..0a545f23de 100644 --- a/railties/lib/rails/configuration.rb +++ b/railties/lib/rails/configuration.rb @@ -1,5 +1,6 @@ require 'rails/plugin/loader' require 'rails/plugin/locator' +require 'active_support/ordered_options' module Rails class Configuration @@ -23,9 +24,9 @@ module Rails @serve_static_assets = true for framework in frameworks - self.send("#{framework}=", Rails::OrderedOptions.new) + self.send("#{framework}=", ActiveSupport::OrderedOptions.new) end - self.active_support = Rails::OrderedOptions.new + self.active_support = ActiveSupport::OrderedOptions.new end def after_initialize(&blk) @@ -218,7 +219,7 @@ module Rails def i18n @i18n ||= begin - i18n = Rails::OrderedOptions.new + i18n = ActiveSupport::OrderedOptions.new i18n.load_path = [] if File.exist?(File.join(root, 'config', 'locales')) diff --git a/railties/lib/rails/core.rb b/railties/lib/rails/core.rb index 6e7f912e6d..a5e51ad04a 100644 --- a/railties/lib/rails/core.rb +++ b/railties/lib/rails/core.rb @@ -70,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 |