Programming By Contract with Ruby

Discussion in 'Ruby' started by Pete Hodgson, Sep 11, 2008.

  1. Pete Hodgson

    Pete Hodgson Guest

    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
     
    Pete Hodgson, Sep 11, 2008
    #1
    1. Advertising

  2. Pete Hodgson

    Dean Wampler Guest

    [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.rubyforge.org/examples.html

    dean

    On Thu, Sep 11, 2008 at 11:53 AM, Pete Hodgson <> 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
     
    Dean Wampler, Sep 11, 2008
    #2
    1. Advertising

  3. On Sep 11, 10:53 am, Pete Hodgson <> 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, Sep 11, 2008
    #3
  4. Pete Hodgson

    Pete Hodgson Guest

    [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_in_c.html.

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

    Daniel Berger wrote:
    > On Sep 11, 10:53 am, Pete Hodgson <> 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
    >
    >
     
    Pete Hodgson, Sep 11, 2008
    #4
  5. Daniel Berger wrote:
    > On Sep 11, 10:53 am, Pete Hodgson <> 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
     
    Jörg W Mittag, Sep 12, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael D. Crawford
    Replies:
    0
    Views:
    714
    Michael D. Crawford
    Feb 22, 2005
  2. CorporateRebel.com
    Replies:
    2
    Views:
    428
    Whitecrest
    May 2, 2004
  3. BCC
    Replies:
    6
    Views:
    434
    Geniousoverhere
    May 9, 2004
  4. Specialist Verilog Engineers Roles
    Replies:
    0
    Views:
    492
    Specialist Verilog Engineers Roles
    Jun 27, 2007
  5. Robert Dober
    Replies:
    4
    Views:
    208
    Robert Dober
    Apr 22, 2008
Loading...

Share This Page