I am seeking excellent examples of Ruby DSLs (Domain Specific Languages). Which repositories, projects do you know of that are worth a read? Why is it (or: are they) great
Some good ruby DSLs I can think of are hpricot and sinatra
In the area of Behaviour-Driven Development you can check out:
Though I have to admit the RSpec code leaves me scratching my head sometimes because I'm still very much a novice.
Another example, of course, is Rake, the Ruby build system. What makes a DSL "good" in my opinion:
Ruby on Rails' Active Record is a DSL!
http://apidock.com/rails/ActiveRecord/Base
Also this episode of code school might be interesting as it leads up to building a DSL (where I learned Active Record was a DSL)
http://www.codeschool.com/courses/ruby-bits-part-2
The above course also talks about external and internal DSLs. Cucumber is an example of an external DSL where you need to build a parser and compiler, etc. Active Record is an example of an Internal DSL that runs inside some existing code.
Have you checked out the Docile gem, it may be the easiest and cleanest way to meet your needs?
Rake and Rack are some good examples of DSL's. If you want some more examples, check these out:
If you want to get started on making your own, here's an excellent tutorial called Building a DSL in Ruby.