[TxMt] Re: Properly escaping characters in ruby script

Allan Odgaard mailinglist at textmate.org
Wed Apr 8 20:05:22 UTC 2009


On 8 Apr 2009, at 19:20, Ian Duncan wrote:

> Well I rewrote my little script in Ruby and have had mostly success,
> but I need some help escaping things properly. Here's what I'm having
> trouble with: [...]
>
> This is intended to enclose text selected in TextMate in quotation
> marks, and then escape all of the following characters within the the
> quotes, and then use that as the argument to pointfree. What's wrong
> with how I'm doing it?

If this is a TextMate command you can do:

     #!/usr/bin/env ruby
     require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"

     arg = STDIN.read
     arg.chomp!
     system("pointfree #{e_sh arg}")




More information about the textmate mailing list