I am running a rakefile directly from Ruby, in order to run some tests. The tests work fine when run individually from inside TextMate 2, but some of them break when run thru the rakefile directly from Ruby. The reason is that those tests use the TM_SUPPORT_PATH environment variable. That variable doesn't exist when we are running the rakefile directly from Ruby.
Is there a way my rakefile script can ask TextMate for the value of its TM_SUPPORT_PATH even though it is not running inside TextMate? I can solve the problem by just hard-coding the answer into my rakefile, but that is not a portable solution.
(Indeed, the issue arose in the first place because I *was* hard-coding the answer into my rakefile, using TextMate 1; but in TextMate 2, the value of TM_SUPPORT_PATH has changed. That's why I'd like a way to ask TextMate directly "what's your TM_SUPPORT_PATH?")
Thx - m.
On 10 Dec 2013, at 6:05, Matt Neuburg wrote:
[…] Is there a way my rakefile script can ask TextMate for the value of its TM_SUPPORT_PATH even though it is not running inside TextMate? […]
This is not possible. It’s a little tricky because TM_SUPPORT_PATH is setup by the Bundle Support bundle itself, so TextMate does not know anything about it. I think that if an option was to be added, the best approach would be something that allows running TM commands from shell (which has long been on the wish list) then the user could exploit this to run “echo $TM_SUPPORT_PATH”.
It will require some thought before adding such feature, but I’ll keep your use-case in mind.
On Dec 11, 2013, at 6:10 PM, Allan Odgaard mailinglist@textmate.org wrote:
It will require some thought before adding such feature, but I’ll keep your use-case in mind.
OK, thanks. Meanwhile I'm just instructing the user to run TextMate beforehand to learn what the TM_SUPPORT_PATH is, and to hand that in as an environment variable in the `rake` call. :)
$ rake TM_SUPPORT_PATH='/path/to/support/folder' test
m.
-- matt neuburg, phd = matt@tidbits.com, http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html TidBITS, Mac news and reviews since 1990, http://www.tidbits.com