Created
October 25, 2011 20:39
-
-
Save sikachu/1314186 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Highlight Ruby 1.8.x hash rocket | |
" This will prevent you to ever write it again | |
highlight ObsoleteHashRocket ctermbg=red guibg=red | |
au ColorScheme * highlight ObsoleteHashRocket guibg=red | |
au BufEnter * match ObsoleteHashRocket /=>/ | |
au InsertEnter * match ObsoleteHashRocket /=>/ | |
au InsertLeave * match ObsoleteHashRocket /=>/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
Dir['**/*.{rb,erb}'].each do |filename| | |
content = File.read(filename) | |
File.open(filename, "w"){ |f| f.write content.gsub(/:([a-z0-9_]+)\s?=>/, "\\1:") } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment