[TxMt] Printing a Backtick from a Ruby Drag Command

Dru Kepple dru at summitprojects.com
Tue Oct 19 18:00:29 UTC 2010


Hello... I feel like there is a super-simple answer to this, but I've spent more than enough time trying to figure this out on my own, so now I get to ask the TM community.

I'm making a simple drag command, and part of the output involved a backtick.  I'm using Ruby as the language of choice for the command itself, and it seems to be having trouble with the backtick.

I know that the backtick, on it's own, means to run the string at the command line.  But I'm doing something like this:

puts "`"

(Thats double quote, backtick, double quote; in other words, print a backtick, please)

I've actually reduced my command to this simple line in trying to figure out where it's going wrong, and this does not produce any output.  As another example, this:

puts "abcd`efgh"

Will output abcd and that's it.

Now, when I open a new ruby document, add those lines, and run it straight from TM, I get every character I would expect.

This would lead me to believe that somehow, in process of writing ruby that gets interpreted as a snippet, the backtick is actually being used as a backtick, not just another string character.  Do I need to escape this somehow?  I've tried this:

puts "\`"

Which still produces nothing.

Any insight is greatly appreciated.  Thanks.

+dru




More information about the textmate mailing list