[TxMt] Shared Ruby methods for TextMate module

Duane Johnson duane.johnson at gmail.com
Fri Mar 3 20:23:52 UTC 2006


On Mar 3, 2006, at 9:59 AM, Allan Odgaard wrote:

> On 3/3/2006, at 17:18, Gavin Kistner wrote:
>
>> [...] I put one of my files in a path with a space in the name,  
>> and it took me a fair amount of experimenting to figure out how  
>> TextMate and Lua independently wanted to see the URL.
>
> I have this function in the Show TODO List command:
>
>    def TextMate.file_link (file, line = 0)
>      return "txmt://open/?url=file://" +
>        file.gsub(/[^a-zA-Z0-9.-\/]/) { |m| sprintf("%%%02X", m[0]) } +
>        "&line=" + line.to_s
>    end
>
> I will move it to the textmate ruby lib in Support/lib so that Ruby  
> commands can just use this one.
>

Do you mind if I add TextMate.open (currently in the Rails.tmbundle/ 
Support/lib/rails/text_mate.rb file) as well as TextMate.open_url to  
the shared TextMate module?  There may be some other methods in there  
that you'd like moved in to the shared Support/lib also.

Duane Johnson
(canadaduane)
http://blog.inquirylabs.com/





More information about the textmate mailing list