I\'ve just learned the basics of Ruby after being very happy with Python for several years (I\'m still using Python for some things), but I\'d like to know if there\'s an id
While
if __FILE__ == $0 Foo.run end
is the common approach, I'm currently using
if File.identical?(__FILE__, $0) Foo.run end
because programs like ruby-prof can make $0 not equal __FILE__ even when you use --replace-progname.
__FILE__
--replace-progname