Getting SketchUp to play nicely with RubyGems?
-
@richmorin said:
Can anyone comment on the legalities here?
reference: The Legal Agreement, entitled: "Terms of Service"
section 10.3 is of most interest, as to what we CAN do and NOT do with the API. (I will not quote it as the actual document should always be refered to. It could be revised, etc., making my quote worthless.)
section 8.2 is of interest to Google's right to filter content on Google's Services (which applies to the Google Codesite as well and is stated in all Google "Terms of Service" agreements.)
So then I think that Jim's SKX codsite API wiki would be the best place to "prototype" the information, and then let the Google SketchUp Team check it out. I know Scott Lininger is a SKX project member so he can edit/delete stuff on the wiki. You would have to join the project, or else email/PM Jim or I the info, and let us post it.
-
Now I got some questions here - is this a plugin that is going to be distributed?
I would not be comfortable with a plugin changing the Ruby version SU loads.
What if another plugin tried to make SU use another version? Sounds like there's potential for a clash. Since the SU Ruby environment is shared by an unknown number of other plugins, any changes to the core is something that can potentially break something else. -
Check this out, a guy named Andre claims to have gotten SU to load 1.8.7 on Mac/OSX:
http://groups.google.com/group/sketchupruby/browse_frm/thread/fc4278c7a2011582#His site with the instructions:
http://superuser.com/questions/167453/I hope he made backups.
-
@thomthom said:
Now I got some questions here - is this a plugin that is going to be distributed?
ThomThom... how can it be a plugin ?
You can't switch horses in mid-stream.
My interest is controlling MY ruby versions, for the purpose of testing code against differing Ruby versions and Patch Levels. In order to do that, a developer needs multi-version ruby installs and a switching utility.
On Win32... it's pik.
On Unix-like (Linux, OSX, etc.) it's RVM. (Ruby Version Management)
Both are command line utilites.
Both are aimed at Standard Ruby use.NOW... I am contemplating having 2 RVM archives. ONE that is normal, that I use for NON-Sketchup Ruby (Rails, eRuby, Distributed Ruby, etc.)
A Second archive, that (like on the Mac,) is installed beneath the Sketchup Application folder (or maybe in the Google folder.) The second would only be used with, or tweeked specially for Sketchup.
So if I wish to test my plugins on v1.8.0 and v1.8.5 and v1.8.6 ..etc.. I need a means of quickly switching back and forth (when Sketchup is NOT running.)Updating the Ruby version that Sketchup loads is up to the user. Currently on Win32 it's a manual task.
I strongly believe that Sketchup should be "Ruby Version Agile", but that will require a change in the exe source.
-
Will all these 'investegations' also lead to a directory structure of the ruby lib?
I think there are a lot of interesting tools (like an xml parser) which could be used in plugins, but making it work atm is something i have not been able to.
To much files needed spread over several places. -
@pout said:
Will all these 'investegations' also lead to a directory structure of the ruby lib?
I think it's best to keep the dir layouts the same (I in fact have manually copied a whole ruby install into the Sketchup folder.)
So the Sketchup copy just begins in dir:
C:/Programs/Google/Google Sketchup 7/ruby
instead of:
C:/ruby -
So, this means that you can easily adress all ruby code from within Sketchup ruby? Eg. to use rexml?
Are there any know limitations on what version of ruby one can use with sketchup and what not? -
@pout said:
So, this means that you can easily adress all ruby code from within Sketchup ruby? Eg. to use rexml?
(1) We always could.. IF the proper search paths (for the require method,) are added to the $LOAD_PATH array, AND the machine has a full Ruby install, at those path locations. See:
[code] loading from the Standard Ruby Libs
[code] Ruby LOAD PATHs script for (Win32)(2) One of the issues we are discusing in this thread, is a computer having 2 groups of Ruby installations.
- One that is installed in the NORMAL location (C:/ruby) for **Non-*Sketchup use. A separate install location (either under the Sketchup dir, or under the Google dir,) that is ONLY for Sketchup use. This is "partly" the way it is on the Mac, but not all extended libraries were included (if any,) but the dir structure is there.
@pout said:
Are there any know limitations on what version of ruby one can use with sketchup and what not?
I discussed this earlier in this thread, on Win32 so far we must stay in the v.1.8.x branch; as Sketchup calls the Ruby C function rb_set_kcode() on startup. Ruby v.1.9.x has renamed that function, but did not alias from the old function name (Ruby's fault, not Google's.)
I just tried to preset kcode with the interpreter command line arg "-K U" stored in ENV var RUBYOPT, but Sketchup still insists on calling rb_set_kcode(). So for now, no using v.1.9.x branch Ruby interpreter.
ALSO, just because you can load a certain version of Ruby, does not mean that ALL libraries will work with Sketchup. Sketchup is loading Ruby as an embedded subprocess, and not all of the Ruby extended libraries can work when Ruby is loaded this way.
- One that is installed in the NORMAL location (C:/ruby) for **Non-*Sketchup use. A separate install location (either under the Sketchup dir, or under the Google dir,) that is ONLY for Sketchup use. This is "partly" the way it is on the Mac, but not all extended libraries were included (if any,) but the dir structure is there.
-
@dan rathbun said:
There is an override in pik that lets me install Ruby versions to a custom path (instead of %HOMEPATH%/.pik ) Does RVM have this as well ?
@Rich ... the RVM website says on the Command Line Interface page:
http://rvm.beginrescueend.com/rvm/cli/... that RVM does have an option for you to specify a custom location for a "rubyset"
it's option: --prefixI'd imagine it would be used with an install action, maybe something like:
%(#804000)[rvm install ruby-1.8.5-p231 [*flags*] --prefix /Library/Application Support/Google SketchUp 7/SketchUp/ruby/]
- verify with your gurus on the RVM IRC
Without knowing more about what's going on under the Applications dir tree, I can't recommend yet installing to:
%(#804000)[/Applications/Google/SketchUp 7/SketchUP.app/Contents/Frameworks/Ruby.framework/Versions/B/]
-
@unknownuser said:
Ruby LOAD PATHs script for (Win32)](http://forums.sketchucation.com/viewtopic.php?f)":1xbd78u2]
I am trying to write a plugin for sketchup 8 using rubygems....
About the initial load error now, whenever I uncomment the #$LOAD_PATH << "#{pre}/site_ruby/#{ver}" line
(the directory containing the rubygems file among others), sketchup crashes during launch.It is NOT likely you will get a standard RubyGems to work with Sketchup.
One problem may be that RubyGems redefines the Kenel.require() method, which is inherited by Object, and so inherited by all other Ruby objects.
For info on RubyGems, see the Resources list
under the section: TECHNICAL REFERENCESIt is more probable that a special version of RubyGems would be needed for use under Sketchup.
Advertisement