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
On Tue, Oct 19, 2010 at 20:00, Dru Kepple dru@summitprojects.com wrote:
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.
Is the output of your Drag command interpreted in some additional way, like as a snippet? I believe snippets expand backticks.
In such a case, you should be fine if you produce a backslash before the backtick in your output, i.e. something like puts "\`"
HTH, Martin
On Oct 19, 2010, at 11:23 AM, Martin Kühl wrote:
On Tue, Oct 19, 2010 at 20:00, Dru Kepple <dru@summitprojects.commailto:dru@summitprojects.com> wrote: I've tried this:
puts "`"
Which still produces nothing.
you should be fine if you produce a backslash before the backtick in your output, i.e. something like puts "\`"
Thanks, Martin; yes, it's output mode is "Insert as Snippet." I guess that makes sense, then...it's interpreted once by Ruby then again by the Snippet Inserter (I think that's the official name, right?).
At any rate, escaping the escape works. Thanks!
+dru