Ruby Console.... what's up with all the <br/>s?
-
I figured it out, and it's a SU bug. When you have a 0x0a in your string, and you
puts
that string to the console, you'll get a <br/> instead of a newline.At least that's how it working (er, not working?) on my Mac.
Todd
-
@thomthom said:
Maybe you're gotten a plugin being naughty and editing base methods...
Not a chance!! No way, no how - not on this machine.
-
Have you got the latest version? it's a known problem but alex (the person who extended it) said he was looking in to a fix.
-
@remus said:
Have you got the latest version? it's a known problem but alex (the person who extended it) said he was looking in to a fix.
I was under the impression that Todd was referring to the native Sketchup Ruby Console - not the Webdialog version. ..or..?
-
I am referring to the native Ruby console.
-
@unknownuser said:
I figured it out, and it's a SU bug. When you have a 0x0a in your string, and you
puts
that string to the console, you'll get a <br/> instead of a newline.This is very odd.
0x0a
is the new line character\n
- that appear all the time in strings. Not seen this in my PC - and I can't remember seeing it when debugging on my old MacMini. -
Here's a console recreate:
` > abc = "Hi\nthere"
Hi
thereputs abc
Hi<br/>there
nil` -
I'd keep looking for a plugin - one with a WebDialog, one that has redefined
puts
, or modified theString
class, or uses gsub('\n','<br/>') maybe. -
I found it. It is indeed some Google provided SU Ruby code on my machine, and it is doing exactly what Jim coded. I do not know, however, if the code I have is generally available code, and, it certainly (IMHO) should not be interfering with the Ruby Console.
So, SU Bug? Yes.
Will it impact anyone else - I don't know yet. I'm asking Google.
Thanks.
(So, since it IS a SU Bug, do I have to eat my words "no way, no how - not this machine"???? )
-
What Google code is it?
Windows session:
` > abc = "Hi\nthere"
Hi
thereputs abc
Hi
there
nil` -
I'm running the latest SU Pro on a Mac. I think I did bypass an update-gram the other day, so I might not be on the latest.
Advertisement