011/6/2 Jes=FAs Gabriel y Gal=E1n <jgabrielygalan / gmail.com>:
> Not really, I just defined the default value just in case, but it's true
> that in this case it doesn't make much sense.
> El 02/06/2011 20:09, "Chad Perrin" <code / apotheon.net> escribi=F3:

Sorry for the top post and the bad quote, I was using my phone there.
What I wanted to say is that usually I try to think if there's an
appropriate default value for a method parameter. And I just wrote
that, but obviously that default value is not very useful, and I can't
come up with any other one. So I would write:


#executed.rb
module Kernel
 def executed? file
   file =3D=3D $0
 end
end

#main.rb
require 'executed'
if executed? __FILE__
 puts "Executed"
else
 puts "Loaded"
end

Jesus.