1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Routing whitespace cleanup

This commit is contained in:
Joshua Peek 2008-07-28 13:38:20 -05:00
parent 6e75455125
commit e0513e33c4
10 changed files with 84 additions and 89 deletions

View file

@ -360,7 +360,6 @@ module ActionController
# * 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 @@ module ActionController
end
end
Routes = RouteSet.new
ActiveSupport::Inflector.module_eval do

View file

@ -51,7 +51,6 @@ module ActionController
# 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 @@ module ActionController
segments << nil
segments
end
end
end
end

View file

@ -234,7 +234,6 @@ module ActionController
end
nil
end
end
end
end

View file

@ -1,4 +1,3 @@
class Object
def to_param
to_s

View file

@ -130,6 +130,7 @@ module ActionController
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 @@ module ActionController
"#{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 @@ module ActionController
def regexp_has_modifiers?
regexp.options & (Regexp::IGNORECASE | Regexp::EXTENDED) != 0
end
end
class ControllerSegment < DynamicSegment #:nodoc:

View file

@ -834,6 +834,7 @@ uses_mocha 'LegacyRouteSet, Route, RouteSet and RouteLoading' do
puts "#{1 / per_url} url/s\n\n"
end
end
def test_time_generation
n = 5000
if RunTimeTests

View file

@ -597,7 +597,6 @@ XML
end
end
class CleanBacktraceTest < Test::Unit::TestCase
def test_should_reraise_the_same_object
exception = Test::Unit::AssertionFailedError.new('message')