[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Programming By Contract with Ruby

Pete Hodgson

9/11/2008 4:54:00 PM

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

4 Answers

Dean Wampler

9/11/2008 7:14:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

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.rub.../exa...

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.object...
http://www.aspectprogr...
http://aquarium.rub...
http://www.cont...

Daniel Berger

9/11/2008 7:49:00 PM

0

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/project...
http://rubyforge.org/pro...

Regards,

Dan

Pete Hodgson

9/11/2008 9:06:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

Thanks Dan.

Looks like dbc is actually a Design By Contract system for C, using ruby
and Racc to parse an external DSL:
http://www.onlamp.com/pub/a/onlamp/2004/10/28/design_by_contract....

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/project...
> http://rubyforge.org/pro...
>
> Regards,
>
> Dan
>
>

Jörg W Mittag

9/11/2008 11:13:00 PM

0

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/project...
> http://rubyforge.org/pro...

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

jwm