Skip to content

Instantly share code, notes, and snippets.

@user454322
Created January 15, 2013 15:49
Show Gist options
  • Save user454322/4539611 to your computer and use it in GitHub Desktop.
Save user454322/4539611 to your computer and use it in GitHub Desktop.
bad_names=["threadList","handleSuspend","handleDisturb","handleDisturbAction","handleFollowParent","handleFollowChild","handleDisturbSession","handleResume","handleStatus","setBreakPoint","deleteBreakPoint","handleBreak","handleBreak","handleClear","setCommonBreakPoint","handleCommonBreak","handleContinue","handlePrint","handleExec","handleUp","handleDown","handleUp","handleStep","handleNext","handleReturn","handleWhere"]
bad_names.each{|name|
good = String.new(name)
name.split("").each{|charr|
if(charr =~ /[A-Z]/)
good.gsub!(charr,"_"+charr.downcase)
end
}
cmd = "find ./ -name '*.rb' -print0 | xargs -0 sed -i 's/#{name}/#{good}/g'"
puts cmd
Kernel.system(cmd)
}
@user454322
Copy link
Author

Change camelCase (Java style) to underscore (Ruby style)

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