# Doodle-0.0.9 released

**URL:** <https://www.ruby-forum.com/t/doodle-0-0-9-released/134617>\
**Category:** Ruby\
**Created:** [April 12, 2008, 11:51pm UTC](https://www.ruby-forum.com/t/doodle-0-0-9-released/134617 "2008-04-12T23:51:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [April 12, 2008, 11:51pm UTC](https://www.ruby-forum.com/t/doodle-0-0-9-released/134617/1 "2008-04-12T23:51:08Z")

</div>

Doodle 0.0.9 has been released.

Doodle simplifies the definition of Ruby classes by providing a simple  
DSL for declaring attribute validations and conversions.

Doodle is eco-friendly – it does not globally modify Object, Class or  
Module (and it plays nice with yaml).

For more info and examples, see the docs at [http://doodle.rubyforge.org](http://doodle.rubyforge.org).

Changes for 0.0.9:

- new features:
  - :collect now creates array by default if no :init specified  
(thanks to James A. 🙂
  - :collect can now initialize from Enumerables by default
  - raise UnknownAttributeError if initialize called with unspecified  
attribute key
  - added experimental Doodle.context and Doodle.parent (only valid  
during initialization)

- new examples:
  - datatypes
  - mail example
  - Doodle.parent

- new specs for singletons, Doodle.context and Doodle.parent, factory
- updated docs
- removed unused code and tidied up
- bug fixes:
  - fixed memory leak
  - fixed regex for factory methods
  - fixed bug where validate! was creating instance variables with  
defaults
  - fixed errors collection
  - fixed yaml test for JRuby
  - now doesn’t try to define factory method if one with same name  
already defined

Regards,  
Sean

---

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [April 13, 2008, 1:10am UTC](https://www.ruby-forum.com/t/doodle-0-0-9-released/134617/2 "2008-04-13T01:10:10Z")

</div>

On Apr 12, 5:50 pm, “Sean O’Halpin” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Changes for 0.0.9:
> 
> - datatypes
> - fixed yaml test for JRuby
> - now doesn’t try to define factory method if one with same name  
> already defined
> 
> Regards,  
> Sean

Hi Sean,

Doodle looks very promising. I especially like the use on annotation-  
style attribute options.

Couple of questions:

1. None of the examples define regular methods. Is Doodle just for  
data classes?

2. Are you currently using this in any of your other apps?

Thanks,  
T.

---

<div class="post-metadata">

**Author:** ![sean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f0a364/32.png) [@sean](https://www.ruby-forum.com/u/sean)\
**Post date:** [April 13, 2008, 3:43am UTC](https://www.ruby-forum.com/t/doodle-0-0-9-released/134617/3 "2008-04-13T03:43:59Z")

</div>

On Sun, Apr 13, 2008 at 12:09 AM, Trans [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi Sean,
> 
> Doodle looks very promising. I especially like the use on annotation-  
> style attribute options.
> 
> Couple of questions:
> 
> 1. None of the examples define regular methods. Is Doodle just for  
> data classes?

Not at all. The examples focus on data definition because that’s what  
Doodle is for. However, I am finding that I’m defining fewer methods  
on classes simpy because Doodle handles a lot of what those methods  
would be doing. One of the nice things about Doodle is that it makes  
it much clearer what are the properties of an object (attributes +  
constraints) and what are its behaviours (methods). But if it’s  
methods you’re after, the latest version has a mail.rb example  
(translated from an example in Florian F.'s dslkit) which defines a  
#send method 🙂

> 1. Are you currently using this in any of your other apps?

Yes. At work, we’re using it in the development branch of what will  
shortly be a production application. It handles validation of yaml  
configuration files. While this is only using a subset of Doodle, it  
greatly simplifies the task.

I have also been using it for my own experimental projects. For  
example, I’ve been toying with an interactive fiction DSL, a  
Ruby-centric ORM, code generation and a command-line option handler.  
They’re all kind of related and Doodle is making it much easier to see  
and share the similarities. One of the most promising directions of  
this experimentation is shared ‘rich datatypes’. For example, doing  
this:

class Mail \< Doodle::Base  
doodle do  
email :to  
email :from  
end  
…  
end

defines attributes that accept only RFC822-compliant email addresses.  
Look at examples/datatypes.rb for some sample datatype definitions and  
examples/mail-datatypes.rb to see how they’re used. (Note that this is  
enabled in the examples, not in the lib). These are in svn on  
rubyforge, not in the gem.

Having said that, Doodle is very much a work-in-progress (as will be  
evident to anyone reading the code!). There’s a fair bit of behaviour  
that’s not covered by specs and a few tortuous workarounds. In  
particular, I’m finding I keep getting tied up in knots trying to  
handle singleton classes consistently. I’ve had to use some dubious  
hacks in places - the most egregious being reading an object’s inspect  
string to determine if it’s a singleton class. (BTW, If anyone knows a  
better way to discover whether self is a singleton class without  
creating a singleton class in the process, I’d be grateful to learn  
it.)

While I sometimes get the feeling that I shouldn’t be trying to do  
this in Ruby (and I’m sure you appreciate what I mean :), I am  
committed to seeing this through - I’m finding it too useful and fun  
to stop now 🙂

> Thanks,  
> T.

Best regards,  
Sean
