We've all seen this:
{ :symbol => 'value' }
Let's replace all of these ugly-looking old symbol key-value pairs into these ones (respecting the spacing):
{ symbol: 'value' }
So the Regexp find-and-replace command I've used in Vim is the following:
s/:\([a-z_]*\)\(\s*\) =>/\1:\2/g
Therefore we can use sed and pass it to find to replace all of our occurances in the project at once. Like this:
find . -name '*.rb' -print0 | xargs -0 sed -i 's/:\([a-z_]*\)\(\s*\) =>/\1:\2/g'