sketchucation logo sketchucation
    • Login
    ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

    Ruby question

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    9 Posts 5 Posters 560 Views
    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.
    • K Offline
      kydbmaster
      last edited by

      Anyone heard of Iron Ruby? Is it the same language as SU Ruby?

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        I've not heard of it. Why does it matter? Are you an iron ruby expert?

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

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

          @unknownuser said:

          IronRuby is an implementation of the Ruby programming language targeting Microsoft .NET framework.

          Link Preview Image
          IronRuby - Wikipedia

          favicon

          (en.wikipedia.org)

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

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

            IronRuby refers to the programming language in which the Ruby language interpreter is written. The creator of Ruby invented the Ruby language, but implemented the interpreter using the c programming language. There are other Ruby implementations, the best-known written in Java and called JRuby. IronRUby is a Ruby Language implementation written for the .NET framework.

            On Windows, SketchUp uses the original c language interpreter, which is included with SketchUp as a .dll library. The current version of SketchUp's Ruby is 1.8.6.

            Hi

            1 Reply Last reply Reply Quote 0
            • K Offline
              kydbmaster
              last edited by

              So a Ruby script written in IronRuby in .Net with DLR will execute in SketchUP?

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

                Yes, Ruby is Ruby and should run on any implementation.

                But any Ruby code which uses the SketchUp Ruby API methods or classes can only be run from SketchUp because that is the only environment where the methods exist.

                Hi

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

                  @jim said:

                  Yes, Ruby is Ruby and should run on any implementation.

                  Except that SketchUp Ruby is not the full standalone Ruby - so it's quite possible that it won't work if it makes use of features that is missing in SketchUp. Or even modified - the Set class in SketchUp is not the same as the Set class in standalone Ruby. Due to that some Ruby libraries has fail to run under SketchUp.

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

                  1 Reply Last reply Reply Quote 0
                  • AdamBA Offline
                    AdamB
                    last edited by

                    @thomthom said:

                    @jim said:

                    Yes, Ruby is Ruby and should run on any implementation.

                    Except that SketchUp Ruby is not the full standalone Ruby - so it's quite possible that it won't work if it makes use of features that is missing in SketchUp. Or even modified - the Set class in SketchUp is not the same as the Set class in standalone Ruby. Due to that some Ruby libraries has fail to run under SketchUp.

                    Is that right? I believe the Ruby in SketchUp is the full language but with some extra hooks to support that proxy nature of Ruby objects wrt to the underlying COM stuff.

                    How is the behaviour of the Set class different?

                    Developer of LightUp Click for website

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

                      @adamb said:

                      Is that right? I believe the Ruby in SketchUp is the full language but with some extra hooks to support that proxy nature of Ruby objects wrt to the underlying COM stuff.

                      How is the behaviour of the Set class different?

                      http://code.google.com/apis/sketchup/docs/ourdoc/set.html
                      Methods:

                      • clear
                      • contains?
                      • delete
                      • each
                      • empty?
                      • include?
                      • insert
                      • length
                      • new
                      • size
                      • to_a

                      Compared to standard Ruby: http://ruby-doc.org/core/classes/Set.html

                      SetClass.png

                      I believe it was some Googler that mentioned that it was not a full installation. Maybe they meant it was not a standard installation as they modify several methods in the base classes. And I have no idea why they did what they did to the Set class. I've been trying to get info on this for a while now.
                      I can't find the exact thread now, but I did find report is issues when some Ruby packages where tried within Su Ruby. http://forums.sketchucation.com/viewtopic.php?f=180&t=20297&start=0#p169325

                      If you look at the lib/ruby/1.8/ folder for a standard Ruby install you find several classes missing. Base64 is one of them. I've not mapped out everything that's missing.

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

                      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