# File lib/merb-core/dispatch/router/route.rb, line 68 def segments_from_path(path) # Remove leading ^ and trailing $ from each segment (left-overs from regexp joining) strip = proc { |str| str.gsub(/^\^/, '').gsub(/\$$/, '') } segments = [] while match = (path.match(SEGMENT_REGEXP)) segments << strip[match.pre_match] unless match.pre_match.empty? segments << match[2].intern path = strip[match.post_match] end segments << strip[path] unless path.empty? segments end