From: Bill Kelly Date: 2001-12-07T03:28:55+09:00 Subject: [ruby-talk:27724] Re: Package Naming From: "Rich Kilmer" > > 3) Name your packages after your company domain and product (like > sun told us to) > 5) Change the name of the company (and domain) (major refactor) > 6) The library is finally updated to use the standard convention of > "com.domain.libraryname.classname" (major refactor) Just curious, wouldn't a one-liner such as find . -name "*.java" -exec ruby -i -pe 'gsub(/(import\s+com)\.foo/,"\1.bar")' {} \; to change all "import com.foo..." to "import com.bar..." pretty much handle all of the package renaming? (Or am I missing some aspect of it?) (OK whoops I forgot about the 'package' declarations, but we should be able to change the gsub to gsub(/((?:import|package)\s+com)\.foo/,"\1.bar") and still keep our one-liner :-) Regards, Bill