Sha256: 7fe91944f3269f703d0972011eb402ee82cc23b835f2b285bba8dbe120e77700
Contents?: true
Size: 418 Bytes
Versions: 4
Compression:
Stored size: 418 Bytes
Contents
require 'rack' require 'thin' require 'sinatra' class TestServer < Sinatra::Base APP_ROOT = './spec/support' get '*' do rpath=File.join(APP_ROOT,params[:splat][0][1..-1]) mimetype = `file -Ib #{rpath}`.gsub(/\n/,"") #puts "serving #{rpath} with mimetype #{mimetype}" send_file rpath, :stream=>true, :type=>mimetype, :disposition=>:inline end end #t = Thread.new {TestServer.run!} #t.join
Version data entries
4 entries across 4 versions & 1 rubygems