• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Ruby question

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

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

    1 Reply Last reply Reply Quote 0
    • C Offline
      Chris Fullmer
      last edited by 16 Dec 2010, 05:14

      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
      • T Offline
        thomthom
        last edited by 16 Dec 2010, 07:21

        @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 16 Dec 2010, 12:20

          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 16 Dec 2010, 15:22

            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 16 Dec 2010, 15:32

              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
              • T Offline
                thomthom
                last edited by 16 Dec 2010, 15:37

                @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
                • A Offline
                  AdamB
                  last edited by 17 Dec 2010, 17:16

                  @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
                  • T Offline
                    thomthom
                    last edited by 17 Dec 2010, 20:03

                    @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
                    1 / 1
                    • First post
                      5/9
                      Last post
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement