• Login
sketchucation logo sketchucation
  • Login
⚠️ Libfredo 15.4b | Minor release with bugfixes and improvements Update

What version of Ruby should I start learning?

Scheduled Pinned Locked Moved Developers' Forum
20 Posts 6 Posters 928 Views 6 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.
  • M Offline
    matt.gordon320
    last edited by 13 Feb 2014, 22:15

    Hi guys,

    I wanted to see if I could get some feedback on which version of Ruby I should learn and install. I know that SketchUp currently uses 1.8.6, and support for 1.9.3 or 2.0.0 is something we could only take a guess at.

    I'm running Windows machines almost exclusively, so I wanted to see what version I should use. I know there's ways (at least on Mac with RVM) to switch between, but it's pretty over my head at the moment, so I'd like to keep it to as few variables as I can for learning. I snagged a copy of the Pick-Axe for 1.9.3 (and 2.0.0 I think) and am reading through that and reviewing "Why's Poignant Guide" as well.

    Let me know your thoughts if you'd be so kind, thanks!

    Matt

    1 Reply Last reply Reply Quote 0
    • T Offline
      tt_su
      last edited by 14 Feb 2014, 06:01

      For Windows I usually recommend the Ruby Installer for Windows packages. Makes a simple task out of getting Ruby up and running: http://rubyinstaller.org/

      1 Reply Last reply Reply Quote 0
      • M Offline
        matt.gordon320
        last edited by 14 Feb 2014, 16:30

        Thomthom, any preference or suggestion as to 1.9.3 vs 2.0.0?

        Sent from my XT1080 using Tapatalk

        1 Reply Last reply Reply Quote 0
        • A Offline
          Aerilius
          last edited by 14 Feb 2014, 16:50

          Those relevant parts of ruby that you as a beginner need are not different. I'd concentrate on the common denominator (which keeps your scripts compatible no matter what Ruby version is used). The differences lay really in more advanced details.
          The poignant guid is quite enjoyable!

          1 Reply Last reply Reply Quote 0
          • M Offline
            matt.gordon320
            last edited by 14 Feb 2014, 16:59

            Thanks Aerilius,

            I'll probably just go with 1.9.3. Seems to be the most supported in general, the documentation's been out forever.

            ...and yes, I am indeed enjoying Why's Poignant Guide, because Chunky Bacon.

            1 Reply Last reply Reply Quote 0
            • T Offline
              tt_su
              last edited by 14 Feb 2014, 21:05

              @matt.gordon320 said:

              Thomthom, any preference or suggestion as to 1.9.3 vs 2.0.0?

              If you're going to use it for SketchUp then it's logical to use whatever SketchUp uses. However, the differences isn't that great. Learning one language makes it much easier to understand any other languages - you would have understood the basic concepts. Going between versions are easier because it's usually a matter of features and perhaps minor syntax differences.

              1 Reply Last reply Reply Quote 0
              • S Offline
                slbaumgartner
                last edited by 15 Feb 2014, 02:10

                If you want your code to be compatible with SU8 and 2013 releases of SketchUp, you have to stick with Ruby 1.8, which is what's distributed with SU.

                1 Reply Last reply Reply Quote 0
                • M Offline
                  matt.gordon320
                  last edited by 19 Feb 2014, 00:10

                  Sounds good gents, thanks. Ruby 1.8 it is then.

                  I think that'll be the better choice so that if I write something up and it doesn't work, at least it won't be as likely to be a version-dependent syntax error, instead it'll be my own syntax error 😳

                  Looking forward to learning Ruby (in time) and seeing any of you at Base Camp!

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    matt.gordon320
                    last edited by 1 Mar 2014, 00:22

                    Haha perfect timing for SketchUp 2014. Looks like I'll be learning Ruby 2.0.0 instead!

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      Dan Rathbun
                      last edited by 1 Mar 2014, 03:44

                      It hurt so much not being able to tell ya that last week.

                      I'm not here much anymore.

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        tt_su
                        last edited by 3 Mar 2014, 13:22

                        @dan rathbun said:

                        It hurt so much not being able to tell ya that last week.

                        Ditto! I nearly ate my foot!

                        But the major concepts is still the same. It's mostly differ in terms of features and string handling. And you need to beware of the differences between the two if you want to be backward compatible.

                        1 Reply Last reply Reply Quote 0
                        • M Offline
                          matt.gordon320
                          last edited by 7 Mar 2014, 17:32

                          @tt_su said:

                          @dan rathbun said:

                          It hurt so much not being able to tell ya that last week.

                          Ditto! I nearly ate my foot!...And you need to beware of the differences between the two if you want to be backward compatible.

                          Haha well said guys! I'll take that into account as I slowly plod my way through it. I definitely want things to be backward compatible if I can manage it. Looking forward to meeting up with everybody @ Base Camp next month if you're going!

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            Dan Rathbun
                            last edited by 7 Mar 2014, 20:50

                            The difficult thing is SketchUp has used 4 Ruby versions now.

                            Mac: v1.8.5-p0 < 14, and v2.0.0-p247 on 14

                            PC: v.1.8.0-p0 < 8, v1.8.6-p287 on 8 & 13, and v2.0.0-p247 on 14.

                            Older versions are missing some methods the newer versions have. A few methods here and there have been removed.

                            As for the API, some of the collection classes did not mixin Enumerable at all, some not correctly.

                            I always wished for a master table, that listed missing methods, differences etc.
                            But I have never seen one even for normal Ruby.

                            I'm not here much anymore.

                            1 Reply Last reply Reply Quote 0
                            • M Offline
                              matt.gordon320
                              last edited by 10 Mar 2014, 22:49

                              @dan rathbun said:

                              The difficult thing is SketchUp has used 4 Ruby versions now...I always wished for a master table, that listed missing methods, differences etc.
                              But I have never seen one even for normal Ruby.

                              Thanks Dan, I'll have to bookmark this for reference. Knowing what little I know of Ruby thus far, I imagine that'd still be a hell of an undertaking! I think I'll focus on writing for 2.0.0 for now, and worry about stepping whatever I write successfully back down for previous versions later. One thing at a time for me. Are you making out to Base Camp this year, out of curiosity?

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                Dan Rathbun
                                last edited by 11 Mar 2014, 13:30

                                Base Camp, no. Too busy. Don't ski much. It seems like an excuse to get together and party, and I don't party.

                                I'm not here much anymore.

                                1 Reply Last reply Reply Quote 0
                                • M Offline
                                  matt.gordon320
                                  last edited by 11 Mar 2014, 17:10

                                  Right right. Not much of a partier myself, however I am really looking forward to meeting some of the SketchUcation/Ruby community face to face.

                                  Sent from my XT1080 using Tapatalk

                                  1 Reply Last reply Reply Quote 0
                                  • N Offline
                                    Nick60
                                    last edited by 5 Jun 2014, 16:07

                                    Regarding the Ruby 2.0 shift, what's appening to the Sketchup 2014 API ?
                                    It seems the API documentation is still the old one, out there, or at least I coudn't find nothing new about it and that sound strange to me because SU 2014 did introduced some new things (like BIM classification) so I expect to use it also programmatically.

                                    Another really important point would be the avaibility of a list of breaking changes (if any) so we can check ours plugins to remove potential bugs.

                                    Any help will be really appreciated.

                                    1 Reply Last reply Reply Quote 0
                                    • M Offline
                                      matt.gordon320
                                      last edited by 5 Jun 2014, 16:45

                                      @nick60 said:

                                      Another really important point would be the avaibility of a list of breaking changes (if any) so we can check ours plugins to remove potential bugs

                                      +1 👍

                                      I usually try to study up on the API whenever I can, so anything additional like that would be awesome.

                                      1 Reply Last reply Reply Quote 0
                                      • T Offline
                                        tt_su
                                        last edited by 5 Jun 2014, 17:42

                                        We had the longest changelog for the Ruby API ever with the SU2014 release: http://www.sketchup.com/intl/en/developer/docs/releases

                                        We didn't document breaking changes from Ruby 1.8 to Ruby 2.0 as this has been documented extensively by the Ruby community in general.

                                        We did have a breaking change where we moved the Set class to Sketchup::Set - and this is mentioned in the release notes.

                                        API methods for classifiers where something we where unable to get into the last release because Classifiers where changing all too close to release. It is something that will come however.

                                        We are also planning a whole new developer portal.

                                        1 Reply Last reply Reply Quote 0
                                        • N Offline
                                          Nick60
                                          last edited by 5 Jun 2014, 17:59

                                          Thanks a lot!

                                          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