emacs - convert hashrockets helper
As my older projects get moved into the new world order, I find the need to clean up and stop using hashrocket syntax in ruby.
Here's my emacs function to help me out.
(defun convert-hashrockets ()
"Replace ruby hashrockets with new hash syntax"
(interactive)
(goto-char 1)
(while (search-forward-regexp ":\\([-_A-Za-z0-9]+\\)[[:space:]]=>" nil t)
(replace-match ( concat (match-string 1) ":") t nil )))Written by Mr Rogers
Related protips
2 Responses
https://github.com/purcell/ruby-hash-syntax seems to be more comprehensive.
over 1 year ago ·
I hadn't see that. Good catch, and definitely more comprehensive.
over 1 year ago ·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best #Ruby Authors
Sponsored by #native_company# — Learn More
#native_title# #native_desc#