提交 e0513e33 编写于 作者: J Joshua Peek

Routing whitespace cleanup

上级 6e754551
......@@ -360,7 +360,6 @@ def use_controllers!(controller_names)
# * previous namespace is root:
# controller_relative_to( "posts", "anything_with_no_slashes" ) # =>"posts"
#
def controller_relative_to(controller, previous)
if controller.nil? then previous
elsif controller[0] == ?/ then controller[1..-1]
......@@ -370,7 +369,6 @@ def controller_relative_to(controller, previous)
end
end
Routes = RouteSet.new
ActiveSupport::Inflector.module_eval do
......
......@@ -51,7 +51,6 @@ module Routing
# 3) segm test for /users/:id
# (jump to list index = 5)
# 4) full test for /users/:id => here we are!
class RouteSet
def recognize_path(path, environment={})
result = recognize_optimized(path, environment) and return result
......@@ -152,7 +151,6 @@ def to_plain_segments(str)
segments << nil
segments
end
end
end
end
......@@ -234,7 +234,6 @@ def requirement_for(key)
end
nil
end
end
end
end
......@@ -130,6 +130,7 @@ def local_name
def extract_value
"#{local_name} = hash[:#{key}] && hash[:#{key}].to_param #{"|| #{default.inspect}" if default}"
end
def value_check
if default # Then we know it won't be nil
"#{value_regexp.inspect} =~ #{local_name}" if regexp
......@@ -141,6 +142,7 @@ def value_check
"#{local_name} #{"&& #{value_regexp.inspect} =~ #{local_name}" if regexp}"
end
end
def expiry_statement
"expired, hash = true, options if !expired && expire_on[:#{key}]"
end
......@@ -214,7 +216,6 @@ def optionality_implied?
def regexp_has_modifiers?
regexp.options & (Regexp::IGNORECASE | Regexp::EXTENDED) != 0
end
end
class ControllerSegment < DynamicSegment #:nodoc:
......
......@@ -834,6 +834,7 @@ def test_time_recognition
puts "#{1 / per_url} url/s\n\n"
end
end
def test_time_generation
n = 5000
if RunTimeTests
......
......@@ -597,7 +597,6 @@ def with_foo_routing
end
end
class CleanBacktraceTest < Test::Unit::TestCase
def test_should_reraise_the_same_object
exception = Test::Unit::AssertionFailedError.new('message')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册