-
-
Save tjmcewan/9826359 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/env ruby | |
gem 'activesupport' | |
require 'active_support/core_ext/string/inflections' | |
camel = ARGV.first | |
snake = camel.underscore | |
system %{git grep -l #{camel} | xargs ruby -p -i -e '$_.gsub! /#{camel}/, "#{snake}"'} | |
# snakify.rb myVariable | |
# snakify.rb myOtherVariable | |
# ... | |
# git status | |
# git commit -am "Standardized to Awesome naming convention." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool. Just run it on this: http://api.jquery.com and this: http://backbonejs.org/ and this: http://underscorejs.org/ and we're good to go.