sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    Mac User? | Join the Rayscaper Beta for Mac Learn More

    Ruby Console.... what's up with all the <br/>s?

    Scheduled Pinned Locked Moved Developers' Forum
    13 Posts 4 Posters 1.3k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      todd burch
      last edited by

      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

      1 Reply Last reply
      Reply Quote 0
      • T
        todd burch
        last edited by

        @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.

        1 Reply Last reply
        Reply Quote 0
        • R
          remus
          last edited by

          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.

          http://remusrendering.wordpress.com/

          1 Reply Last reply
          Reply Quote 0
          • thomthomT
            thomthom
            last edited by

            @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..?

            Thomas Thomassen β€” SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply
            Reply Quote 0
            • T
              todd burch
              last edited by

              I am referring to the native Ruby console.

              1 Reply Last reply
              Reply Quote 0
              • thomthomT
                thomthom
                last edited by

                @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.

                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply
                Reply Quote 0
                • T
                  todd burch
                  last edited by

                  Here's a console recreate:
                  ` > abc = "Hi\nthere"
                  Hi
                  there

                  puts abc
                  Hi<br/>there
                  nil`

                  1 Reply Last reply
                  Reply Quote 0
                  • J
                    Jim
                    last edited by

                    I'd keep looking for a plugin - one with a WebDialog, one that has redefined puts, or modified the String class, or uses gsub('\n','<br/>') maybe.

                    Hi

                    1 Reply Last reply
                    Reply Quote 0
                    • T
                      todd burch
                      last edited by

                      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"???? 😳 )

                      1 Reply Last reply
                      Reply Quote 0
                      • thomthomT
                        thomthom
                        last edited by

                        What Google code is it?

                        Windows session:

                        ` > abc = "Hi\nthere"
                        Hi
                        there

                        puts abc
                        Hi
                        there
                        nil`

                        Thomas Thomassen β€” SketchUp Monkey & Coding addict
                        List of my plugins and link to the CookieWare fund

                        1 Reply Last reply
                        Reply Quote 0
                        • T
                          todd burch
                          last edited by

                          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.

                          1 Reply Last reply
                          Reply Quote 0

                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                          With your input, this post could be even better πŸ’—

                          Register Login
                          • 1 / 1
                          • First post
                            Last post
                          Buy SketchPlus
                          Buy SUbD
                          Buy WrapR
                          Buy eBook
                          Buy Modelur
                          Buy Vertex Tools
                          Buy SketchCuisine
                          Buy FormFonts

                          Advertisement