[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.
Advertisement