Accessing Ruby libraries
-
I'd like to use Cucumber to run tests on SketchUp plugin code. In pursuit of this, I've been playing with setting up a DRb server in a plugin. This failed, at first, because SU doesn't provide the DRb library. So, I tried adding my local (Mac OS X 10.5.8) libraries to "$:". This crashed, as described in http://pastie.org/675716.
So, I'm really looking for two kinds of help. I'd like to know whether and how I can add libraries to SU. I'd also be happy to get comments and suggestions on how to approach the general problem of linking Cucumber and SketchUp.
While I'm stuck on DRb, I've been thinking about passing files back and forth, using
rename()
to ensure that I don't try to read a file before it's ready. Basically, Cucumber (C) and SketchUp (S) would interact as follows:create x.tst.tmp, output test code, close file
rename x.tst.tmp to x.tst
S: detect x.tst, read test code
S: rename x.tst to x.tst.old
S: eval the test code
S: create x.res.tmp, output results, close file
S: rename x.res.tmp to x.res
detect x.res, read results
rename x.res to x.res.old
handle resultsDoes this seem like a reasonable approach?
Advertisement