Good way to test a script
-
Hello,
I'm stupid I know, but what do you guys do to test a script that you've wrote?
My method gets me on my nerves by now. It goes like this:1 write a ruby script, and save it in the plug-ins folder
2 open sketchup
3 take notice of error message
4 close sketchup
5 modify script
6 goto step 2 until script works.There must be a more comfortable way to test a ruby script??
please help
edit:
Found a solution myself:http://www.johnj.com/drawing/sketchup/ruby-plugins-for-sketchup/
edit: But it doesn't work for me, can anyone please help?
-
I just reload the script by using the Ruby Console:
load 'filename.rb'
-
I use Jim Foltz's Ruby Toolbar plugin. It will load and reload a plugin file: http://forums.sketchucation.com/viewtopic.php?t=1542
That plugin in the 1st post looks interesting, but looks like it checks a folder every second, as long as sketchup is running. Do you really want that?
-Kwok
-
@liquid98 said:
edit: But it doesn't work for me, can anyone please help?
Put your scripts in a subfolder of the Plugins folder, call it "Dev" or "Liquid" or whatever, and that reloader should work better (you really do not want to reload all scripts in the "Plugins" folder.)
The reloader can be tweeked to reload upon a larger interval (rather than 1 sec.)
-
tt's way works OK for me. One less plugin, and when debugging, the ruby console is open anyway. btw, I use web console too.
-
Thanks guys for the input!
-
Here's a topic I started with some good info about debugging scripts:
http://forums.sketchucation.com/viewtopic.php?f=180&t=34052 -
@pixero said:
Here's a topic I started with some good info about debugging scripts:
http://forums.sketchucation.com/viewtopic.php?f=180&t=34052That's a really useful thread indeed, thnx
Advertisement