Am 05.01.2013 16:45, schrieb tamouse mailing lists:
> On Fri, Jan 4, 2013 at 9:45 PM, Derrick B. <lists / ruby-forum.com> wrote:
>> Thanks!  This is all good information, but I feel I need to improve my
>> Ruby basics first before learning to use these frameworks.  I will
>> install them to at least take a peek, though.
>
> There is much much more to programming that learning a bit of syntax.
> Learning *how* to structure and write the kinds of applications you
> want now is going to serve you as you progress.

On the other hand, you can also get "lost" in a framework, especially
as a beginner.

For not too complex (!) tasks you can already achieve much with a
single file containing all needed classes, the optparse library and
(of course) a test file or test files
-> no need to cut a gem; easy installation (copying into search path);
    all code in one place.

I often use the following structure:

-----
#!/usr/bin/env ruby
# short description, copyright

require 'optparse'
require 'whatever'

module MyApp  # prevents name clashes

   # constants and class definitions
   # ...
   # ...
   # ...

   class Application
     # provides a run! method
   end


   if __FILE__ == $0
     Application.new.run!  # not called if file is required (by tests)
   end

end  # of module
-----

Regards,
Marcus


-- 
<https://github.com/stomar/>