Srijayanth Sridhar
5/6/2009 10:54:00 AM
[Note: parts of this message were removed to make it a legal post.]
I was thinking something of this sort:
class MyDsl
def load_helper_methods filename
MyDsl.class_eval(File.read(filename))
end
end
and the DSL itself would contain two parts really, one file where the helper
methods are defined, and another for the actual DSL.
Basically:
$ cat foo.dsl
load_helper_methods "my_helpers"
# the rest of the DSL
# follows
etc
Now, for some annoying reason my head swims with yet other possibilities
such as making the helper methods a Module and have it be included in the
class etc. Kid in a candy store and all that. Too many options.
Jayanth
On Wed, May 6, 2009 at 12:42 PM, Robert Dober <robert.dober@gmail.com>wrote:
> On Wed, May 6, 2009 at 6:49 AM, Srijayanth Sridhar <srijayanth@gmail.com>
> wrote:
> > Thanks Brian,
> >
> > All of these help. Eventually I would like those using the DSL to define
> > their own helper methods.
>
> ... which have scope of?
> Robert
>
>