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

[code] ruby_const_update.rb : ver 1.0.0

Scheduled Pinned Locked Moved Developers' Forum
1 Posts 1 Posters 973 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.
  • D Offline
    Dan Rathbun
    last edited by 6 Aug 2010, 14:01

    [code] ruby_const_update.rb


    Summary

    Updates older Ruby versions to have constants

    like 1.8.7 and 1.9.x, specifically:

    RUBY_COPYRIGHT, RUBY_DESCRIPTION and

    RUBY_PATCHLEVEL if less than ver 1.8.5-p12


    Background

    I asked ThomThom to check his Mac, for the values of several Ruby global constants. I wanted to know what the Mac Sketchup 7.x Ruby patchlevel was (as distro'd by Google.)

    He replied (in topic Re: PC v MAC webdialog populate ,) thus:

    @thomthom said:

    Mac Mini Intel - OSX 10.5
    ` > PLATFORM
    i686-darwin8.10.1

    RUBY_VERSION
    1.8.5
    RUBY_RELEASE_DATE
    2006-08-25`

    This is the release date for v 1.8.5 initial (or p0 as it's refered to in 1.9.x)

    There were at least 8 patch level updates that followed the initial release in the 1.8.5 branch: p1, p2, p12, p35, p52, p114, p115 and p231. (At least those are the ones I could find that had precompiled binaries. There may have been a few unstable patch levels that didn't "live" long, ie: p11 and p113.)

    @thomthom said:

    > RUBY_PATCHLEVEL Error: #<NameError: (eval): uninitialized constant RUBY_PATCHLEVEL>

    According to the ChangeLog, the RUBY_PATCHLEVEL constant was added into the codebase on 2006-11-26. So the first patch level it would be valid in would be: v 1.8.5-p2 (Released 2006-12-04.)

    • The weird thing is it was bugged in this release, as the constant return 5000, instead of 2.

    Note that for Win32, the next available release for the precompiled Legacy One-Click Installer was r22 (which included v 1.8.5-p12, release date 2006-12-25.) And also again for Installer releases r23 and r24. (The latter releases just updated 3rd party DLLs, and SciTE editor, etc.)

    @thomthom said:

    > RUBY_DESCRIPTION Error: #<NameError: (eval): uninitialized constant RUBY_DESCRIPTION>

    Looks like RUBY_DESCRIPTION and RUBY_COPYRIGHT didn't make it in until v 1.8.7 inital (Released 2008-05-31.)

    @unknownuser said:

    [ruby:1qi5ekvx]%(#000000)[Sat May 31 22:11:15 2008 Kazuhiro NISHIYAMA <zn _ @ _ mbf.nifty.com >

    • version.c (ruby_description, ruby_copyright): backported from 1.9. bug#19002, `

    • error.c (report_bug): uses ruby_description.]`

    Searching the latest 1.8.5 and 1.8.6 ChangeLog files does not find mention of these constants. (So it seems they were never back-ported to those versions.)

    **** So, a pure Ruby patch for versions older than and 1.8.7, is in order. ****


    ChangeLog

    ver 1.0.0

    • Initial Release - 06 AUG 2010

    Patch

    A pure Ruby patch for versions older than and 1.8.7:
    For Sketchup you can put the file in the Tools folder, or the Plugins folder. (You might even have it in a plugin subfolder, and prepend the folder name to the require path in the ruby example statement below. This case is where a developer needs to be sure all users have this file.)
    For a full Ruby install you could put it in any of the Ruby folders that are in the $LOAD_PATH (such as "ruby/lib/site_lib/#{ver}")

    Usage: At the top of a file in which you'd want to use these constants...

    require('ruby_const_update.rb') if RUBY_VERSION<'1.8.7'

    [floatr:1qi5ekvx]PUBLIC DOMAIN
    Redistrutable!
    No Restrictions.[/floatr:1qi5ekvx]ruby_const_update.rb

    I'm not here much anymore.

    1 Reply Last reply Reply Quote 0
    • 1 / 1
    1 / 1
    • First post
      1/1
      Last post
    Buy SketchPlus
    Buy SUbD
    Buy WrapR
    Buy eBook
    Buy Modelur
    Buy Vertex Tools
    Buy SketchCuisine
    Buy FormFonts

    Advertisement