Skip to content

Instantly share code, notes, and snippets.

@dariocravero
Created October 3, 2010 22:44
Show Gist options
  • Save dariocravero/609022 to your computer and use it in GitHub Desktop.
Save dariocravero/609022 to your computer and use it in GitHub Desktop.
# Small reformats
if !absolute_map
path.gsub!(%r{/?index/?}, '') # Remove index path
path[0,0] = "/" unless path =~ %r{^\(?/} # Paths must start with a /
path.sub!(%r{/(\))?$}, '\\1') # Remove latest trailing delimiter
path.gsub!(/\/(\(\.|$)/, '\\1') # Remove trailing slashes
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment