Scripted main in Ruby
Sometimes you have ruby code that is meant to be required by another library or used as a standalone script.. enter "scripted main"
module MyTools
... stuff ...
end
if $0 == __FILE__
# Run itself when the script is directly executed:
MyTools.start(ARGV)
end
Written by Leo Gallucci
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#