File.copy() not working?
-
I get errors when I try to use File.copy and File.move in my script.
File.copy Error; #<NoMethodError; (eval);58; undefined method `copy' for File;Class> (eval);58
Don't understand this. According tot he Ruby docs they should be there....
-
Hi Thomthom !
File.methods.sort
I don't see any move or copy method...
-
I'm trying to search the web for this, I find some palces which mentions that you have to do
require 'ftools'
But that doesn't work either...
This really has gotten me stomped. Might have to sort to .bat files, but I really don't understand this...
-
ftools looks like something you have to download, as in, an add-on Library to Ruby.
-
I found this file 'ftools' below... And it seems to work well...
Do you have also this file? There are many 'ftools' files on the web!
-
Don't have ftools anywhere on my system.
So I need to include this with my plugin in order to make it work?
Is SU's implementation of Ruby partial? -
Google does not ship a full install of Ruby with SketchUp. Therefore, if you choose a Library or external package that is not included with Google's distribution, you get to do several things:
- Make sure you conform to any licensing requirements for what you distribute
- Make sure you make users of aware if there are any platform differences
- Test the package you obtain with the releases of Ruby that are shipped with SketchUp (different for Mac and PC)
- And, the obvious, package and handle the install of your script and its resources in a manner you feel is appropriate.
Have fun!
-
Is there a reason SU doesn't ship with the full version of Ruby included? How does one know what is or is not included?
Chris <trying to wrap my head around this 'ruby built into SU' concept and I think I'm getting closer.....maybe)
-
@unknownuser said:
Google does not ship a full install of Ruby with SketchUp. Therefore, if you choose a Library or external package that is not included with Google's distribution, you get to do several things:
- Make sure you conform to any licensing requirements for what you distribute
- Make sure you make users of aware if there are any platform differences
- Test the package you obtain with the releases of Ruby that are shipped with SketchUp (different for Mac and PC)
- And, the obvious, package and handle the install of your script and its resources in a manner you feel is appropriate.
Have fun!
That's interesting. Wasn't aware that SU's ruby was that different. I've used this site; http://www.ruby-doc.org/ for my Ruby references. Thanks for the head up.
1:
Regarding this ftools; from what I gather from this page: http://www.ruby-doc.org/stdlib/libdoc/ftools/rdoc/files/ftools_rb.html
there shouldn't be a problem for me to include ftools with my plugin?2: Platform differences? as in host OS? or host application?
3: As for this specific plugin it's a tool to accompany V-Ray for SketchUp which is Windows only, so I can skip the Mac testing.
But does Ruby on Mac behave differently? I've tested a couple of plugins for other here on this forum on my Mac Mini and there appear to be some oddities occasionally.4: The way I do it now is have one .rb file in the plugin root, then add supporting file to a subfolder where as I put both of them into a .zip when I distribute. Is another method prefered?
-
@chris fullmer said:
Is there a reason SU doesn't ship with the full version of Ruby included? How does one know what is or is not included?
Chris <trying to wrap my head around this 'ruby built into SU' concept and I think I'm getting closer.....maybe)
Good question. I'm coming from a JS, VBS and PHP background, still getting used to this Ruby thing. Or at least SU-Ruby...
-
I figured it out by downloading the full ruby install, so I could learn and use Ruby outside of SU (and follow existing tutorials), and after seeing what it expanded to, it was obvious that the full install doesn't come with SketchUp.
Advertisement