Skip to content

Instantly share code, notes, and snippets.

@achiurizo
Created February 1, 2012 19:15
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save achiurizo/1718723 to your computer and use it in GitHub Desktop.
Save achiurizo/1718723 to your computer and use it in GitHub Desktop.
sinatra hack to mount via padrino mount
# foo.rb
class Foo < ::Sinatra::Base
class << self
def dependencies; []; end
def setup_application!; end
end
get '/' do
'wubwub'
end
end
# config/apps.rb
Padrino.mount("Main::App", :app_file => File.expand_path('../app/app.rb', __FILE__).to('/')
Padrino.mount("Foo", :app_file => File.expand_path('../foo.rb', __FILE__).to('/foo')
@ainformatico
Copy link

Another method we should define is def reoad!; end. Prevents error when reloading the app.
Thanks for the hack!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment