External DSL

35 views
Skip to first unread message

Jason

unread,
Jul 10, 2012, 4:07:10 PM7/10/12
to Ruleby
I was also interested in an external DSL.
I had heard that Matt Smith was working on this a couple of years
ago.
The roadmap for V0.6 on the WIKI mentioned an external DSL using
TreeTop.
Was there ever any progress on this?


In the end I probably just want to be able to provide a limited UI to
build some rules around my model.
I could probably figure out how to do that using some rule
"templates" to generate the rules in a .rb file.
I don't really want to write the files to the file system. I would
rather store them in the DB.
Is there a way to load rules from a string?

I'm pretty sure this could be done with some ruby meta programming.



Matthew Smith

unread,
Jul 10, 2012, 5:17:31 PM7/10/12
to rul...@googlegroups.com
Hi Jason,

An external DSL was never implemented. As part of the work that was done for this, rules can be created with the "rule" method after including the RuleHelper. So rules do not have to be created within a rulebook. The rules returned from the RuleHelper#rule method can then be asserted into the engine.

Rule "actions" are procs. I never implemented a way to store / generate the proc. If you could generate the proc from a DSL then you could store the DSL code.

Thanks,

Matt
> --
> You received this message because you are subscribed to the Google Groups "Ruleby" group.
> To post to this group, send email to rul...@googlegroups.com.
> To unsubscribe from this group, send email to ruleby+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ruleby?hl=en.
>

Reply all
Reply to author
Forward
0 new messages