[ANN] NotNaughty - Validation Framework 0.4

Discussion in 'Ruby' started by Florian Aßmann, Feb 25, 2008.

  1. Hi folks,

    I just released my first gem. It's a validation framework that targets an easy
    way of creating validations and reuse them in any ruby project that needs to
    validate any kind of values.

    It's syntax is close to the ActiveRecord and Assistance validations with some
    enhancements.

    http://rubyforge.org/projects/not-naughty

    == Features

    * Easy to extend
    * Easy to adapt (provides an adapter/plugin for sequel models)

    class MyClass
    extend NotNaughty
    validated_before :clone

    # *snip*

    end

    class MyModel < Sequel::Model
    is :not_naughty
    end

    * Supports inheritance
    * Validator can handle object states
    * Supports chained conditions for validations
    * Comes with default validations for presence, length, ...
    * Magic builder methods that take global attributes and conditions

    validates:)attribute1, :attribute2) {
    confirmation and presence :if => [:true?, :really_true?]
    }
    validates {
    confirmation_of :attribute1, :attribute2
    presence_of :attribute1, :attribute2, :if => [:true?, :really_true?]
    }
    validates:)if => [:true?, :really_true?]) {
    presence_of :attribute1, :attribute2
    }

    They just drop in if you inherit from NotNaughty::Validation.

    * Error messages are eval'ed (not glued) which gives you more control
    * Lots of examples in the specs and documentation

    == Installation

    sudo gem install not_naughty

    == ToDo

    Awaiting feature requests...

    Cheers
    Florian
     
    Florian Aßmann, Feb 25, 2008
    #1
    1. Advertising

  2. Florian Aßmann

    Avdi Grimm Guest

    On Mon, Feb 25, 2008 at 9:57 AM, Florian A=DFmann
    <> wrote:

    Nice! A non ActiveRecord-specific validations module is something
    I've wanted in the past.

    --=20
    Avdi
     
    Avdi Grimm, Feb 25, 2008
    #2
    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. Anatoly Volodko
    Replies:
    1
    Views:
    2,106
    Mattias Sjögren
    Aug 14, 2003
  2. Charles A. Lackman
    Replies:
    1
    Views:
    1,361
    smith
    Dec 8, 2004
  3. Mark
    Replies:
    4
    Views:
    1,723
    Juan T. Llibre
    Nov 17, 2005
  4. javadude
    Replies:
    0
    Views:
    728
    javadude
    Feb 16, 2005
  5. Florian Aßmann

    [ANN] NotNaughty 0.6.2

    Florian Aßmann, Oct 31, 2008, in forum: Ruby
    Replies:
    0
    Views:
    91
    Florian Aßmann
    Oct 31, 2008
Loading...

Share This Page