[TxMt] [Ruby] Name collision with Plist gem

cremes.devlist at mac.com cremes.devlist at mac.com
Tue Nov 14 22:04:05 UTC 2006


 
On Tuesday, November 14, 2006, at 03:12PM, <cremes.devlist at mac.com> wrote:
>I'm currently testing out TextMate for doing some Ruby coding. It gets very high marks from the community at large and so far things have looked fairly good.
>
>However, I ran into a bug and I need the list's help to solve it.
>
>The code I'm writing and testing uses the plist gem [1] from rubyforge. Whenever I try to test code that uses any functionality from that gem, the test fails with the following error:
>
>  1) Error:
>test_temp(TC_MyTest):
>NameError: uninitialized constant Some::Plist
>method some in temp.rb at line 12
>method test_temp in tc_temp.rb at line 13
>
>(where Some is a class I created for the purpose of trapping this bug.)

I found a solution though I don't like it very much. I changed my #require to use the absolute path to the plist gem, so now there isn't a name collision.

Interestingly, TextMate does have its own plist implementation. It's stored at TextMate.app/Contents/SharedSupport/Support/lib and is a compiled binary object. It's using lots of CoreFoundation stuff internally (run 'nm plist.bundle' for a list of symbols) and thankfully there aren't any method name collisions.

Is there a way to force TextMate to put your local gems repository earlier in the load path than its own internal libraries?

cr



More information about the textmate mailing list