Stephane Wirtel wrote:
> Hi all,
> 
> with ruby, it's possible to check if I am in the main script or in a
> module with if __name__ == 'main'
> 
> Is there the same thing with ruby ?
> 
> Thanks
Here is a way to find if a ruby file is a module or the main script.

if $0 == __FILE__
  puts "This is the main function"
else
  puts "This is a module"
end

Is it right ?