[ruby-talk:00202] Re: execute if called rather than required

From: shugo@... (Shugo Maeda)
Date: 1999-01-20 13:44:42 UTC
List: ruby-talk #202
Julian Fondren <julian@imaji.net> writes:

> What is the ruby equivalent of python's
> 
> if __name__ == '__main__':

Try this:

  if __FILE__ == $0
    ...
  end

Shugo

In This Thread