I’m trying to get a reference to the script passed to the ruby interpreter. For example, if I’m running ruby foo.rb I want to get a reference to the foo.rb file.
I think in Python this would be accessible through sys.argv[0]. One could call __FILE__ however this is not solution I’m looking for, since __FILE__ yields the file inside which the currently execute code lies in.
Is there any way to do that?
I found
$0is the name of the file used to start the program. Easy enough.