On 17.11.2009 09:48, Michelle Pace wrote:
> Sorry Ryan... I'm still not getting it :-(
> 
> What is that exclamation mark doing? Could I substitute lets say a 'w' 
> for the exclamation mark?

Yes.  The exclamation mark is just more visible than the "w".  In the 
particular case of OptionParser the difference between #parse and 
#parse! is that the latter actually modifies the argument (typically 
ARGV), which btw. is a nice thing because what it leaves behind in ARGV 
are only file names and so using ARGF works well together with 
OptionParser.  I typically do

OptionParser.new do |opts|
   opts.on ...
end.parse! ARGV

Then, depending on what the program does

ARGF.each do |line|
   puts "read a line: #{line}"
end

Kind regards

	robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/