Docunext


Question about Sinatra top level DSL Applications

March 29th, 2010

I've just send a question to the Sinatra mailing list:

Hello,

Would it be possible to sub-class or mixin an app designed at the top level of the Sinatra DSL into a Sinatra::Base subclass?

For example, I'm impressed with Nesta and want to work with it some more, but I'm used to working with apps developed as a subclass of Sinatra::Base. I've previously forked Nesta and modified it into a subclass. That worked OK but I ran into some unrelated issues, and am finding the task of keeping in line with the upstream git repo daunting.

The Mickey Mouse hacker in me would try slurping the file and eval'ing it within a module. That has serious limitations, though.

I'd venture to guess that there is a more elegant solution. Any ideas?

Thanks!

-- http://www.docunext.com/ http://www.docunext.com/blog/

Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022