Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use a proxy class for the generated application

To use the generated sinatra application from a rackup file we needed a
simple proxy class that hooks up all the methods rack expects.
  • Loading branch information...
commit 46b746bb0a7df7b461816b5aa09374731cf60c28 1 parent 4bd9a23
@vanstee authored
View
1  lib/hovercraft.rb
@@ -1 +1,2 @@
+require 'hovercraft/server'
require 'hovercraft/version'
View
14 lib/hovercraft/server.rb
@@ -0,0 +1,14 @@
+require 'hovercraft/builder'
+
+module Hovercraft
+ class Server
+ def initialize
+ builder = Builder.new
+ @application = builder.application
+ end
+
+ def call(env)
+ @application.call(env)
+ end
+ end
+end
View
7 spec/hovercraft/server_spec.rb
@@ -0,0 +1,7 @@
+require 'hovercraft/server'
+
+describe Hovercraft::Server do
+ it 'is a rack application' do
+ subject.respond_to?(:call).should be_true
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.