Skip to content

Instantly share code, notes, and snippets.

@tjmcewan
Forked from puyo/encamel.rb
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjmcewan/9826359 to your computer and use it in GitHub Desktop.
Save tjmcewan/9826359 to your computer and use it in GitHub Desktop.
#!/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."
@puyo
Copy link

puyo commented Mar 28, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment