All tests pass in merb
This commit is contained in:
parent
aeb6aa056c
commit
c967a02ca0
|
@ -102,4 +102,7 @@ require 'cgi'
|
||||||
require File.join(File.dirname(__FILE__), "merb_support", "param_parser.rb")
|
require File.join(File.dirname(__FILE__), "merb_support", "param_parser.rb")
|
||||||
require File.join(File.dirname(__FILE__), "merb_support", "url_encoded_pair_parser.rb")
|
require File.join(File.dirname(__FILE__), "merb_support", "url_encoded_pair_parser.rb")
|
||||||
require File.join(File.dirname(__FILE__), "merb_support", "indifferent_access.rb")
|
require File.join(File.dirname(__FILE__), "merb_support", "indifferent_access.rb")
|
||||||
|
require File.join(File.dirname(__FILE__), "merb_support", "support.rb")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# This class has dubious semantics and we only have it so that
|
# This class has dubious semantics and we only have it so that
|
||||||
# people can write params[:key] instead of params['key']
|
# people can write params[:key] instead of params['key']
|
||||||
# and they get the same value for both keys.
|
# and they get the same value for both keys.
|
||||||
|
|
||||||
class HashWithIndifferentAccess < Hash
|
class HashWithIndifferentAccess < Hash
|
||||||
def initialize(constructor = {})
|
def initialize(constructor = {})
|
||||||
if constructor.is_a?(Hash)
|
if constructor.is_a?(Hash)
|
||||||
|
@ -123,16 +122,4 @@ class HashWithIndifferentAccess < Hash
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module ActiveSupport #:nodoc:
|
|
||||||
module CoreExtensions #:nodoc:
|
|
||||||
module Hash #:nodoc:
|
|
||||||
module IndifferentAccess #:nodoc:
|
|
||||||
def with_indifferent_access
|
|
||||||
hash = HashWithIndifferentAccess.new(self)
|
|
||||||
hash.default = self.default
|
|
||||||
hash
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ module Webrat
|
||||||
end
|
end
|
||||||
|
|
||||||
if defined?(Merb)
|
if defined?(Merb)
|
||||||
puts "************ Booting merb mode"
|
|
||||||
require File.join(File.dirname(__FILE__), "boot_merb.rb")
|
require File.join(File.dirname(__FILE__), "boot_merb.rb")
|
||||||
else
|
else
|
||||||
require File.join(File.dirname(__FILE__), "boot_rails.rb")
|
require File.join(File.dirname(__FILE__), "boot_rails.rb")
|
||||||
|
|
|
@ -123,7 +123,7 @@ module Webrat
|
||||||
def merge_hash_values(a, b) # :nodoc:
|
def merge_hash_values(a, b) # :nodoc:
|
||||||
a.keys.each do |k|
|
a.keys.each do |k|
|
||||||
if b.has_key?(k)
|
if b.has_key?(k)
|
||||||
case [a[k], b[k]].map(&:class)
|
case [a[k].class, b[k].class]
|
||||||
when [Hash, Hash]
|
when [Hash, Hash]
|
||||||
a[k] = merge_hash_values(a[k], b[k])
|
a[k] = merge_hash_values(a[k], b[k])
|
||||||
b.delete(k)
|
b.delete(k)
|
||||||
|
|
Loading…
Reference in New Issue