GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of lifo/doc-rails
Description: Repository for improving Rails documentation
Homepage: http://www.rubyonrails.org
Clone URL: git://github.com/zmalltalker/doc-rails.git
markup revision in AC::Routing::Optimisation
Xavier Noria (author)
Thu Apr 10 13:21:19 -0700 2008
commit  e07e56b5dfb301eaf74e07e30b75afa8ba42da34
tree    b344242cff904f991a5cfcfdef11f822acabea81
parent  de25ecbc992cf2560a2854a69d4755d4e40812d3
...
1
2
3
4
 
5
6
7
8
 
9
10
11
...
41
42
43
44
 
45
46
47
48
49
50
51
52
 
53
54
 
 
 
55
56
 
57
58
59
...
77
78
79
80
 
81
82
83
...
106
107
108
109
 
110
111
112
...
1
2
3
 
4
5
6
7
 
8
9
10
11
...
41
42
43
 
44
45
46
47
48
49
50
 
 
51
52
 
53
54
55
56
 
57
58
59
60
...
78
79
80
 
81
82
83
84
...
107
108
109
 
110
111
112
113
0
@@ -1,11 +1,11 @@
0
 module ActionController
0
   module Routing
0
     # Much of the slow performance from routes comes from the
0
- # complexity of expiry, :requirements matching, defaults providing
0
+ # complexity of expiry, <tt>:requirements</tt> matching, defaults providing
0
     # and figuring out which url pattern to use. With named routes
0
     # we can avoid the expense of finding the right route. So if
0
     # they've provided the right number of arguments, and have no
0
- # :requirements, we can just build up a string and return it.
0
+ # <tt>:requirements</tt>, we can just build up a string and return it.
0
     #
0
     # To support building optimisations for other common cases, the
0
     # generation code is separated into several classes
0
@@ -41,19 +41,20 @@ module ActionController
0
           end
0
         end
0
 
0
- # Temporarily disabled :url optimisation pending proper solution to
0
+ # Temporarily disabled <tt>:url</tt> optimisation pending proper solution to
0
         # Issues around request.host etc.
0
         def applicable?
0
           true
0
         end
0
       end
0
 
0
- # Given a route:
0
- # map.person '/people/:id'
0
+ # Given a route
0
       #
0
- # If the user calls person_url(@person), we can simply
0
+ # map.person '/people/:id'
0
+ #
0
+ # If the user calls <tt>person_url(@person)</tt>, we can simply
0
       # return a string like "/people/#{@person.to_param}"
0
- # rather than triggering the expensive logic in url_for
0
+ # rather than triggering the expensive logic in +url_for+.
0
       class PositionalArguments < Optimiser
0
         def guard_condition
0
           number_of_arguments = route.segment_keys.size
0
@@ -77,7 +78,7 @@ module ActionController
0
 
0
           elements << '#{request.relative_url_root if request.relative_url_root}'
0
 
0
- # The last entry in route.segments appears to # *always* be a
0
+ # The last entry in <tt>route.segments</tt> appears to *always* be a
0
           # 'divider segment' for '/' but we have assertions to ensure that
0
           # we don't include the trailing slashes, so skip them.
0
           (route.segments.size == 1 ? route.segments : route.segments[0..-2]).each do |segment|
0
@@ -106,7 +107,7 @@ module ActionController
0
           super.insert(-2, '?#{args.last.to_query}')
0
         end
0
 
0
- # To avoid generating http://localhost/?host=foo.example.com we
0
+ # To avoid generating "http://localhost/?host=foo.example.com" we
0
         # can't use this optimisation on routes without any segments
0
         def applicable?
0
           super && route.segment_keys.size > 0

Comments

    No one has commented yet.