From: Jim Freeze Date: 2006-06-20T05:08:41+09:00 Subject: Re: best way to deal with command line options ------=_Part_147292_14814301.1150747716381 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 6/19/06, thomas coopman wrote: > > > Another little question, what's the best way to do when writing a program > in ruby, > keep the core and the main in different files, place them in the same > file,.. or doesn't it matter? SOC - Separation of Concerns. At least keep them in separate classes. If the work class is sharable, put it in a separate file or library. Example: require 'rubygems' require 'commandline' class App < CommandLine::Application def initialize author "Me, Myself" synopsis "[-dhv] file1 file2" short_description "...." expected_args :file1, :file2 end def main MyWorkClass.new(args, opts) end end class MyWorkClass def initialize ... this class does all the work. The command line app is just interface with the user end end Thanks, > > Thomas Coopman > > Jim -- Jim Freeze ------=_Part_147292_14814301.1150747716381--