The worst part of attempting to write a DSL is worrying that you'll get stuck without knowing where to turn. What's the difference between class_eval
and instance_eval
? And how do you know when to use them?
Learn to make code that expresses your team's shared understanding of a business problem.
Projects like Ruby on Rails provide sensible DSLs for managing relationships between models in your system. The Sinatra framework gives you a DSL to provide affordances in your code so that web requests are handled the way you expect. Chef was created as a DSL for managing server configurations
You can model your project's needs with you own DSL too.
From the author of Clean Ruby, Ruby DSL Handbook gives you the knowledge you need to build the right tool for your business domain.
Use business terms in code that make sense to you and your team; read Ruby DSL Handbook and bend your code to demands of your business.
“I learned some new aspects of Ruby I was able to apply the very same day” —Michael Buckbee
“If you're a journeyman-or-better craftsman in any real OO language coming to Ruby, Jim Gay is one of three or four guys you'll want to read avidly, just to keep your sanity.” —Jeff Dickey
Get your team on the same page. Free your mind with the ability to create code that represents your ideas better. Remove the often distracting boilerplate code and wrap up your concepts in easy to use methods.
Ruby DSL Handbook is currently being written and you'll receive regular updates as the content is updated.
Grab a copy to:
class_eval
and instance_eval
and know the trade-offs in designing your DSL.method_missing
, define_method
and other approaches to handling messages.See a how the metaprogramming can become a simple tool as support for DSL methods are built. See the benefits to properly structruing generated methods to allow for easy debugging.
Get a handle on the samples from the book to use in your own projects. Read through the test code. Keep a quick refrence for instance_eval, module_eval, class_eval, instance_exec, module_exec, and class_exec, and more.
Pick up the easy to read ebook and take it with you everywhere. Read about how Ruby works to help you create interfaces that reflect your needs and read about open source projects and how they implement their DSL code.
Pick it up now and get all updates for $119. You'll be automatically updated as new content is added.
Or get the package and share with your entire team for only $599.
“With Jim's new book, Ruby DSL Handbook, he has once again tackled a difficult to understand problemspace in Ruby and brought it into readily understandable examples and explanations. His grasp upon the language comes out in force, in a way that even beginners can understand. Reading this book opened my eyes to different ways to tackle DSLs. It immediately had me wanting to explore different ways of reimplementing one of my own.” —Jim Nanney
Grab a copy to:
class_eval
and instance_eval
and know the trade-offs in designing your DSL.method_missing
, define_method
and other approaches to handling messages.Get a handle on the samples from the book to use in your own projects. Read through the test code. Keep a quick refrence for instance_eval, module_eval, class_eval, instance_exec, module_exec, and class_exec, and more.
Pick up the easy to read ebook and take it with you everywhere. Read about how Ruby works to help you create interfaces that reflect your needs and read about open source projects and how they implement their DSL code.
Pick it up now and get all updates for $47. You'll be automatically updated as new content is added.
Pick up the easy to read ebook and take it with you everywhere. Read about how Ruby works to help you create interfaces that reflect your needs and read about open source projects and how they implement their DSL code.
Get Ruby DSL Handbook for the cost of few trips to the coffee shop at only $24 in PDF and ePub. Get it that cheap for a limited time only. You'll be automatically updated as new content is added.
You'll automatically get updates as the book and extras are updated. The email you use to purchase will receive all notifications when newer versions are released. Buying now means you'll be notified via email as updates are regularly made.
If your whole team needs to tackle the problem, grab a Team License copy get started. Buy a Team ebook License
Jim is the author of Clean Ruby, and the Lead Developer for Radiant CMS and is a prolific contributor to it and many open-source projects. At Saturn Flyer LLC he’s built numerous Radiant sites, custom applications, and award winning graphic design and has had his designs published in HOW Magazine and The Best of LogoLounge. He’s been a co-host of the Ruby 5 podcast, speaker at RubyConf 2013, RubyConf 2014, Ruby Kaigi, Wroclove.rb, ArrrrCamp, and RubyNation, co-founder of Arlington Ruby and has been professionally building Ruby and Rails applications since 2006.
“Jim is one of those rare people who can crank out award winning site designs, go and implement the backend Rails functionality, and be lead engineer for his project team… all on one project. I’ve seen him do it.
Jim is someone to watch out for, and get on your project if you can. (Especially with his upcoming book, which I think will rock the Ruby on Rails world a little bit, changing how the community thinks about large/complex Rails codebases.).“ — Ryan Wilcox, Owner, Principal Engineer at Wilcox Development Solutions and former co-worker