From 3952268929d72b691c1db925c5e9bf7dff8962ce Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Thu, 15 Jul 2010 16:18:25 -0300 Subject: Bump up to rack-mount 0.6.9 and rack-mount-0.6.6.pre removed from action_dispatch vendor --- .../rack-mount-0.6.6.pre/rack/mount/multimap.rb | 53 ---------------------- 1 file changed, 53 deletions(-) delete mode 100644 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/multimap.rb (limited to 'actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/multimap.rb') diff --git a/actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/multimap.rb b/actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/multimap.rb deleted file mode 100644 index 0f8eaaec67..0000000000 --- a/actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/multimap.rb +++ /dev/null @@ -1,53 +0,0 @@ -begin - require 'nested_multimap' -rescue LoadError - $: << File.expand_path(File.join(File.dirname(__FILE__), 'vendor/multimap')) - require 'nested_multimap' -end - -module Rack::Mount - class Multimap < NestedMultimap #:nodoc: - def store(*args) - keys = args.dup - value = keys.pop - key = keys.shift - - raise ArgumentError, 'wrong number of arguments (1 for 2)' unless value - - unless key.respond_to?(:=~) - raise ArgumentError, "unsupported key: #{args.first.inspect}" - end - - if key.is_a?(Regexp) - if keys.empty? - @hash.each_pair { |k, l| l << value if k =~ key } - self.default << value - else - @hash.each_pair { |k, _| - if k =~ key - args[0] = k - super(*args) - end - } - - self.default = self.class.new(default) unless default.is_a?(self.class) - default[*keys.dup] = value - end - else - super(*args) - end - end - alias_method :[]=, :store - - undef :index, :invert - - def height - containers_with_default.max { |a, b| a.length <=> b.length }.length - end - - def average_height - lengths = containers_with_default.map { |e| e.length } - lengths.inject(0) { |sum, len| sum += len }.to_f / lengths.size - end - end -end -- cgit v1.2.3