From: "I. E. Smith-Heisters" Date: 2008-06-18T02:59:02+09:00 Subject: detect if required or executed? Hi all, Is anyone aware of a way to detect if a file has been required from another ruby process, or is being executed from the commandline? I've been doing this hack: do_executable_behavior unless ENV['DONT_RUN'] but that's clearly not ideal. I though maybe I could add something to the bangline? But that wouldn't help if someone runs the script indirectly with "ruby script.rb". Something like Module.included would be great if there was a "required" method, I could just set a DONT_RUN variable there. Thanks, Ian