Actually, here's a better patch that removes the link to the method when coming from an eval.<br><br>-- Elliot<br><br><br><div class="gmail_quote">On Fri, Jan 16, 2009 at 1:33 PM, Elliot Winkler <span dir="ltr"><<a href="mailto:elliot.winkler@gmail.com">elliot.winkler@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi all,<br><br>I've noticed for a while now that when executing a Ruby script in TextMate, RubyMate will crap out with a "No such file or directory" error. For example, here's the output from RubyMate:<br>

<br>Loaded suite /Users/elliot/Sites/localhost/htdocs/proj/work/store/test/models/fast/order_transaction_test<br>Started<br>....F.................. <br>Finished in 0.155584 seconds.<br><br>  1) Failure:<br>test_ordertransaction_HASH_refund_should_partially_refund_the_transaction_by_the_given_amount_if_one_is_passed(OrderTransactionTest::TestOrdertransactionHASHRefund_3042040)<br>

/usr/local/lib/ruby/1.8/pathname.rb:420:in `lstat': No such file or directory - /Users/elliot/Sites/localhost/htdocs/proj/work/store/test/models/fast/(eval) (Errno::ENOENT) from<br>/usr/local/lib/ruby/1.8/pathname.rb:420:in `realpath_rec' from<br>

/usr/local/lib/ruby/1.8/pathname.rb:453:in `realpath' from<br>/Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/run_script.rb:83 from<br>/Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/executor.rb:88:in `call' from<br>

/Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/executor.rb:88:in `run' from<br>/Applications/TextMate.app/Contents/SharedSupport/Support/lib/io.rb:41:in `call' from<br>/Applications/TextMate.app/Contents/SharedSupport/Support/lib/io.rb:41:in `exhaust' from<br>

/Applications/TextMate.app/Contents/SharedSupport/Support/lib/io.rb:41:in `each_line' from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/io.rb:41:in `exhaust' from<br>/Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/process.rb:165:in `run' from<br>

/Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/executor.rb:100:in `run' from<br>/Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/executor.rb:199:in `process_output_wrapper' from<br>

/Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/executor.rb:99:in `run' from<br>/Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/htmloutput.rb:134:in `call'<br>from<br>/Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/htmloutput.rb:134:in `show' from<br>

/Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/executor.rb:84:in `run' from<br>/Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/run_script.rb:65<br><br>Whereas executing the script in the terminal results in:<br>

<br>Loaded suite order_transaction_test<br>Started<br>....F..................<br>Finished in 0.151166 seconds.<br><br>  1) Failure:<br>test_ordertransaction_HASH_refund_should_partially_refund_the_transaction_by_the_given_amount_if_one_is_passed(OrderTransactionTest::TestOrdertransactionHASHRefund_8582050)<br>

    [(eval):1:in `create_refund_transaction'<br>     /Users/elliot/Sites/localhost/htdocs/proj/work/store/app/models/order_transaction.rb:122:in `refund!'<br>     order_transaction_test.rb:138:in `test_ordertransaction_HASH_refund_should_partially_refund_the_transaction_by_the_given_amount_if_one_is_passed'<br>

     /usr/local/lib/ruby/gems/1.8/gems/jeremymcanally-context-0.5/lib/context/suite.rb:32:in `run'<br>     /usr/local/lib/ruby/gems/1.8/gems/jeremymcanally-context-0.5/lib/context/suite.rb:30:in `each'<br>     /usr/local/lib/ruby/gems/1.8/gems/jeremymcanally-context-0.5/lib/context/suite.rb:30:in `run'<br>

     /usr/local/lib/ruby/gems/1.8/gems/jeremymcanally-context-0.5/lib/context/suite.rb:32:in `run'<br>     /usr/local/lib/ruby/gems/1.8/gems/jeremymcanally-context-0.5/lib/context/suite.rb:30:in `each'<br>     /usr/local/lib/ruby/gems/1.8/gems/jeremymcanally-context-0.5/lib/context/suite.rb:30:in `run']:<br>

#<Mock:0x192dc94>.create_refund_transaction(:order, 1, 111) - expected calls: 0, actual calls: 1<br>Similar expectations:<br>#<Mock:0x192dc94>.create_refund_transaction(:order, 33, 111)<br><br>23 tests, 9 assertions, 1 failures, 0 errors<br>

<br>I finally figured out today that it's because there's an eval in the backtrace which is being interpreted as a filename. So RubyMate tries to expand the path of the file, but of course "(eval)" is not a valid filename.<br>

<br>I was surprised that this was not already being taken into account. But attached is a patch that fixes this for me.<br><font color="#888888"><br>-- Elliot Winkler<br>
</font></blockquote></div><br>