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
<code/>and<pre/>for code samples.