Skip to content

Commit

Permalink
Ruby 1.9: string is not enumerable, so #exclude? is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Dec 27, 2009
1 parent 3a79117 commit 7c4fb93
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions actionpack/lib/action_dispatch/routing/mapper.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'active_support/core_ext/enumerable'

module ActionDispatch module ActionDispatch
module Routing module Routing
class Mapper class Mapper
Expand Down Expand Up @@ -58,15 +56,15 @@ def extract_path_and_options(args)


[ normalize_path(path), options ] [ normalize_path(path), options ]
end end

# match "account" => "account#index" # match "account" => "account#index"
def using_to_shorthand?(args, options) def using_to_shorthand?(args, options)
args.empty? && options.present? args.empty? && options.present?
end end

# match "account/overview" # match "account/overview"
def using_match_shorthand?(args, options) def using_match_shorthand?(args, options)
args.present? && options.except(:via).empty? && args.first.exclude?(":") args.present? && options.except(:via).empty? && !args.first.include?(':')
end end


def normalize_path(path) def normalize_path(path)
Expand Down

0 comments on commit 7c4fb93

Please sign in to comment.