From: "James B. Byrne" Date: 2006-02-17T10:40:47+09:00 Subject: Re: Ruby script to Module/Class refactor > > James, > > Try reading the RubyGarden wiki page WhatIsAnObject[0] and Allen Holub's > "Why Getter and Setter Methods are Evil" article and you should have a > better idea of what OO is supposed to look and feel like. * > > And I just found "Tell, Don't Ask"[2] by the Pragmatic Programmers, > which helps me better understand OO design. > > HTH, > -dave > > * Both links were recently posted in other threads, and I learned a lot > from them. Thanks! :) > > [0] http://www.rubygarden.org/ruby/ruby?WhatIsAnObject > [1] http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html > [2] http://www.pragmaticprogrammer.com/ppllc/papers/1998_05.html Thanks, I will check these out directly. In the mean time I have come up with this as my initial take on things. It does not yet actually move things about but it seems to encompass most of the directory stuff contained in the original script. ------------------------------------------------------------------------------ #++ # mv2dir.rb # version 1.0 - 2006 Feb 16 - James B. Byrne - # # find, move and optionally rename data files that match glob expression # provided. # # ruby mv2dir.rb source_dir glob_exp [target_dir=./] [ext] # or # ruby mv2dir.rb -s source_dir -g glob_exp [-t target_dir] [-e ext] # # TODO: # Options: # -e --ext Append as suffix to each # filename in source. # -g --glob Use as glob pattern to # select source files. # -h --help Display version, help text and exit. # -l --log Log activity to syslog (DEFAULT). # -L --nolog Do not log activity to syslog. # -v --version Display version and exit. # -V --verbose Display activity to STDOUT. # -s --source Use as path to source directory. # -t --target Use as path to target directory. #<