public Method

RouteSet.to_plain_segments(str)

this must be really fast

Source Code

# File action_controller/routing/recognition_optimisation.rb, line 147
def to_plain_segments(str)
  str = str.dup
  str.sub!(/^\/+/,'')
  str.sub!(/\/+$/,'')
  segments = str.split(/\.[^\/]+\/+|\/+|\.[^\/]+\Z/) # cut off ".format" also
  segments << nil
  segments
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.