Created
February 12, 2013 06:14
-
-
Save Kerrick/4760586 to your computer and use it in GitHub Desktop.
Convert ruby 1.8 style hashes (hashrockets) into ruby 1.9 style hashes (json-style) Source: http://robots.thoughtbot.com/post/17450269990/convert-ruby-1-8-to-1-9-hash-syntax
This file contains 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
perl -pi -e 's/:([\w\d_]+)(\s*)=>/\1:/g' path/to/file.rb |
This file contains 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
:%s/:\([^ ]*\)\(\s*\)=>/\1:/g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment