Created
March 3, 2012 14:51
-
-
Save daviddavis/1966515 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
| code = "__ == __ == Date.parse(date.sub(/(\d+)[-\/](\d\d).(\d{4})/,'\\3-\\1-\\2')).strftime('%b %d, %Y')" | |
| sub = "Date.parse(date.sub(/(\d+)[-\/](\d\d).(\d{4})/,'\\3-\\1-\\2')).strftime('%b %d, %Y')" | |
| code.gsub("__", sub) # Date.parse(date.sub(/(d+)[-/](dd).(d{4})/,'--'))... | |
| code["__"] = sub # only fill in one at a time. fails when sub = "__method__" | |
| code.split("__").join(sub) # ugly but seems to work |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment