Skip to content

Instantly share code, notes, and snippets.

@puyo
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save puyo/9825681 to your computer and use it in GitHub Desktop.
Save puyo/9825681 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
gem 'activesupport'
require 'active_support/core_ext/string/inflections'
snake = ARGV.first
camel = snake.camelize(:lower)
system %{git grep -l #{snake} | xargs ruby -p -i -e '$_.gsub! /#{snake}/, "#{camel}"'}
# encamel.rb my_variable
# encamel.rb my_other_variable
# ...
# git status
# git commit -am "Standardized to JS naming convention."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment