Skip to content

Instantly share code, notes, and snippets.

@xinuc
Created December 7, 2011 08:51
Show Gist options
  • Save xinuc/1442051 to your computer and use it in GitHub Desktop.
Save xinuc/1442051 to your computer and use it in GitHub Desktop.
# use colon syntax for your hashes
# ruby colonize.rb old_ruby_file.rb > new_ruby_file.rb
code = File.read ARGV[0]
code.scan(/\:(\S+?) =>/).each{|a| code.sub!(/:#{a.first} =>/, "#{a.first}:")}
puts code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment