Skip to content

Instantly share code, notes, and snippets.

@Kerrick
Created February 12, 2013 06:14
Show Gist options
  • Save Kerrick/4760586 to your computer and use it in GitHub Desktop.
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
perl -pi -e 's/:([\w\d_]+)(\s*)=>/\1:/g' path/to/file.rb
:%s/:\([^ ]*\)\(\s*\)=>/\1:/g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment