title: Ruby - get the file being executed
body: <p>I'm trying to get a reference to the script passed to the ruby interpreter. For example, if I'm running <code>ruby foo.rb</code> I want to get a reference to the <code>foo.rb</code> file.</p>
  
  <p>I think in Python this would be accessible through <code>sys.argv[0]</code>. One could call <code>__FILE__</code> however this is not solution I'm looking for, since <code>__FILE__</code> yields the file inside which the currently execute code lies in.</p>
  
  <p>Is there any way to do that?</p>