Programming By Contract with Ruby

Hi Folks,

Does anyone know of a Programming By Contract framework for ruby? It
seems like fertile ground, given the dynamic nature of the language. I’m
imagining some kind of DSL that allows a developer to annotate a
class/module with invariants, and also to annotate methods with pre- and
post-conditions.

Cheers,
Pete

I have an example on the Aquarium site of doing basic “design
(programming)
by contract”. Look near the bottom of this page for “Design by
Contract”:
http://aquarium.rubyforge.org/examples.html

dean

Thanks Dan.

Looks like dbc is actually a Design By Contract system for C, using ruby
and Racc to parse an external DSL:
Radar – O’Reilly.

I’ll take a look at rubydbc. Anyone else have any input?

On Sep 11, 10:53 am, Pete H. [email protected] wrote:

Hi Folks,

Does anyone know of a Programming By Contract framework for ruby? It
seems like fertile ground, given the dynamic nature of the language. I’m
imagining some kind of DSL that allows a developer to annotate a
class/module with invariants, and also to annotate methods with pre- and
post-conditions.

Cheers,
Pete

http://rubyforge.org/projects/rubydbc/
http://rubyforge.org/projects/dbc/

Regards,

Dan

Daniel B. wrote:

On Sep 11, 10:53 am, Pete H. [email protected] wrote:

Does anyone know of a Programming By Contract framework for ruby? It
seems like fertile ground, given the dynamic nature of the language. I’m
imagining some kind of DSL that allows a developer to annotate a
class/module with invariants, and also to annotate methods with pre- and
post-conditions.
http://rubyforge.org/projects/rubydbc/
http://rubyforge.org/projects/dbc/

There’s also https://RubyForge.Org/projects/handshake/. I have no
experience with any of those three, but I like the clever name (-:

jwm