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

From: Julian Fondren <julian@...>
Date: 1999-01-20 13:08:20 UTC
List: ruby-talk #200
Greetings!

What is the ruby equivalent of python's

if __name__ == '__main__':

which allows certain commands to be executed if the module is required
rather than called in it's own right - as an argument to ruby or a file
with the executable bit and something like `#!/usr/bin/env ruby' as the
first line?

Thanks!


In This Thread