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

···

On Thu, Sep 11, 2008 at 11:53 AM, Pete Hodgson <phodgson@lyris.com> 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

--
Dean Wampler
http://www.objectmentor.com
http://www.aspectprogramming.com
http://aquarium.rubyforge.org
http://www.contract4j.org

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

Regards,

Dan

···

On Sep 11, 10:53 am, Pete Hodgson <phodg...@lyris.com> 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

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?

Daniel Berger wrote:

···

On Sep 11, 10:53 am, Pete Hodgson <phodg...@lyris.com> 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 Berger wrote:

···

On Sep 11, 10:53 am, Pete Hodgson <phodg...@lyris.com> 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/&gt;\. I have no
experience with any of those three, but I like the clever name (-:

jwm