Skip to content

Instantly share code, notes, and snippets.

@puyo
Last active Aug 29, 2015
Embed
What would you like to do?
#!/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