[Question]how to load a tool from an external .rb file
-
Hi All

Once I made a simple linedrawing tool, capable of drawing straigt lines.
Its saved in a file called mylinetool.rb in \Plugins\as_plugins\as_rubyeditor\snippetsThe question is, how do I make a small rubyscript that loads and runs the tool from Alex Schreyers Ruby Code Editor?
Is it something like "load_file", "include" or "load(filename)"??
Can it be loaded from a URL? eg. http://www.google.com/mylinetool.rb
thanks in advance
-Rasmus
-
If it is a plugin.. it is no longer a "snippet" ...
Move it into YOUR author sub-directory of the "Plugins" directory.
So.. example, say you use "Rasmus" as your author sub-directory:
require('Rasmus/mylinetool.rb')
This ensures the file is only loaded once.To load it again, regardless of whether it has been previously loaded, (say during debugging,) use:
load('Rasmus/mylinetool.rb')***** If you use double-quoted pathstrings, make sure you use slashes (/) and NOT backslashes (%(#BF0000)[]) !
-
Your question is so basic, it marks you as a Ruby Newbie. So you need this advice:
-
Thank you Dan. It worked

I have started to go through the Ruby Resource as you suggested. And I also found the answer for my own question in there.

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement