From: Horst Duchene Date: 2002-03-22T19:07:28+09:00 Subject: Re: camelCase and underscore_style "Tobias Reif" schrieb im Newsbeitrag news:3C9AEEC7.2080409@pinkjuice.com... > Bil Kleb wrote: > > > > Right. For example, if I wanted to change all occurances of > > reynolds_number to reynoldsNumber in all the .rb files in > > the current directory, I'd issue > > > > ruby -pi -e"gsub(/reynolds_number/,'reynoldsNumber')" *.rb > I lastly converted from CamelCase to underscore_style with the help of the following script (only for selected methods): Horst #!ruby -pi.bak $methods.each_pair do |k,v| gsub!(k,v) end BEGIN { $methods = Hash.new ["removeFirst", "currentEdge", "atEnd", "moveBackwardUntil", "basicBackward", "incrementStop"].each do |m| $methods[m] = m.gsub(/([A-Z])/) {|c| '_' + c.downcase} end }