8spb_g
Last Updated: February 25, 2016
·
979
· bunnymatic
11d948cbd083298dea9f4f32c71f6427

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 )))
Say Thanks
Respond

2 Responses
Add your response

15922

https://github.com/purcell/ruby-hash-syntax seems to be more comprehensive.

over 1 year ago ·
15936
11d948cbd083298dea9f4f32c71f6427

I hadn't see that. Good catch, and definitely more comprehensive.

over 1 year ago ·