Thanks! That is exactly what I was looking for! I've updated my blog entry (http://www.cfcl.com/rdm/weblog/archives/001716.html) with some speculation on how this capability might be used.
Posts
-
RE: Ruby methods in dynamic component attributes?
-
Ruby methods in dynamic component attributes?
It occurs to me that it would be very convenient and powerful
to be able to define Ruby methods and invoke them in dynamic
component attribute expressions, as:=foo_method(42)
However, I don't see any indication that this is possible.
Pointers, anyone?-r
-
Using Cucumber with SketchUp
I've been working on ways to use Cucumber to test SketchUp plugins. I've written up my current results and plans in:
"Using Cucumber with SketchUp"
http://www.cfcl.com/rdm/weblog/archives/001714.html -
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?