From: Caleb Clausen Date: 2010-06-11T19:47:49+09:00 Subject: Re: creating a gem structure for command line program On 6/11/10, R.. Kumar wrote: > Are there any naming conventions here that have to be followed. Have to be followed? No. Your gem will still work if you don't follow the convention. Should be followed? Yes. People expect your code to adhere to the standard method of organization that has evolved; it helps them navigate your project even if they don't know your code. Also, these conventions represent collective wisdom about how projects should be organized. > Assume project and gem is named foo. > 1. bin/foo - does foo have to be the project/gem name Should be. > 2. lib/foo/main.rb - does main.rb have to be foo.rb > Why i ask is because, typically main.rb would contain > a class named "Foo". If you have a file named lib/foo/main.rb, it should contain a class named Foo::Main. I take it you have no such class, so you shouldn't make a file of that name. The class named Foo should reside in your lib/foo.rb. > 3. lib/foo.rb - currently I've got an empty file. Typically, this file would require everything (or many things) in lib/foo/, as well as the implementation of class/module Foo itself.