The Cleanroom Pattern in Ruby

1 · Seth Vargo · Aug. 26, 2014, midnight
I recently gave a talk at Philly.rb, the Ruby meetup in Philadelphia, PA entitled "The Cleanroom Pattern - More safely evaluating DSLs with Ruby". You can watch the full Cleanroom DSL video online, but I decided to also write the contents of the talk into a blog post. Background on DSLs Most Ruby-based DSLs are created using a simple instance_eval. While slightly less dangerous than eval, instance_eval still opens the system up to dangerous circumstances. Consider the following DSL file, Proje...