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:
parent
6e75455125
commit
e0513e33c4
10 changed files with 84 additions and 89 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -234,7 +234,6 @@ module ActionController
|
|||
end
|
||||
nil
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
class Object
|
||||
def to_param
|
||||
to_s
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue