Found it. Had to escape '('.
Ruby method for shoving a variable into BBEdit as an unwritten document:
def open_in_BBEdit(this_var)
this_var = this_var.inspect
this_var.gsub(/\(/, "\\(").gsub(/\)/, "\\)")
system "echo '#{this_var}' | bbedit"
end
You might need to modify this for escaping special characters that might
screw up Ruby or the Shell.
Cheers
On Monday, January 19, 2015 at 7:17:31 PM UTC-5, Rich F wrote:
>
> Hiya folks.
>
> Not sure if this is something I'm overlooking or if I'm demanding too
> much. So, I post.
>
> I have a Ruby variable that I would like automatically output to an
> unwritten document in BBEdit. I'm using the CLI with the following command
> in IRB which works like a charm:
>
> exec "echo #{output} | bbedit"
>
> The variable I'm trying to output in my current testing is much more
> complex and 930 lines long, 223 columns wide, with various markup
> characters that might screw things up. It's not working.
>
> Am I missing something? Is there a set of characters that might interrupt
> this sort of thing?
>
> Cheers
>
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].