Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Duplicate AS code no longer needed

  • Loading branch information...
commit da62a7c5362ee76e8fdc8cb942c4c1eefccfeab0 1 parent c28a45a
Yehuda Katz + Carl Lerche authored
Showing with 4 additions and 35 deletions.
  1. +4 −3 railties/lib/rails/configuration.rb
  2. +0 −32 railties/lib/rails/core.rb
View
7 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 @@ def initialize
@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 @@ def plugin_locators
def i18n
@i18n ||= begin
- i18n = Rails::OrderedOptions.new
+ i18n = ActiveSupport::OrderedOptions.new
i18n.load_path = []
if File.exist?(File.join(root, 'config', 'locales'))
View
32 railties/lib/rails/core.rb
@@ -70,36 +70,4 @@ def public_path=(path)
@@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
Please sign in to comment.
Something went wrong with that request. Please try again.