sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

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

    Scheduled Pinned Locked Moved Developers' Forum
    13 Posts 4 Posters 488 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 Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              todd burch
              last edited by

              I am referring to the native Ruby console.

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                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 Offline
                  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 Offline
                    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 Offline
                      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 Offline
                        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 Offline
                          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
                          • 1 / 1
                          • First post
                            Last post
                          Buy SketchPlus
                          Buy SUbD
                          Buy WrapR
                          Buy eBook
                          Buy Modelur
                          Buy Vertex Tools
                          Buy SketchCuisine
                          Buy FormFonts

                          Advertisement