Created
May 18, 2010 21:02
-
-
Save aeden/405544 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# within the else block in paths.rb: | |
path_method = page_name.gsub(/^(the|my) /i, '').gsub(/ page$/i, ' path').gsub(/\s+/, '_') | |
begin | |
send(path_method.to_sym) | |
rescue | |
raise "Can't find mapping from \"#{page_name}\" to a path.\n" + | |
"Now, go and add a mapping in #{__FILE__}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment