Ruby DSL for invoices

C

chris

Hi DSL fans,

I've been playing around with DSLs recently, inspired by the dynamism
you get for free with Ruby, and thought I'd try writing one.

This is my first effort:
http://svn.edendevelopment.co.uk/public/invoice_dsl/

Check out the README.txt for more details. Basically it allows you to
write an invoice in fairly natural language syntax, like this:

new_invoice do
address 'Test Client, Street, ZIP'
code '2006-45'
date '3rd Oct'

work_at 50 do
spent 3.on('Morning meeting')
spent 0.5.on('Making the coffee for the boss').on('3rd Sept')
end
end

And you end up with
http://svn.edendevelopment.co.uk/public/invoice_dsl/2006-45.pdf

It's work in progress, so suggestions for improvements are welcome.
Feel free to adapt it for your needs, but please send me any
significant patches or new templates so we can spread the love.

Original blog post is here:
http://blog.edendevelopment.co.uk/articles/2006/10/03/domain-specific-language-for-invoices

Cheers
Chris
 
C

Chris Parsons

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top