lib/roda/plugins/sinatra_helpers.rb in roda-3.59.0 vs lib/roda/plugins/sinatra_helpers.rb in roda-3.60.0
- old
+ new
@@ -2,13 +2,11 @@
require 'rack/mime'
begin
require 'rack/files'
rescue LoadError
- # :nocov:
require 'rack/file'
- # :nocov:
end
#
class Roda
@@ -223,13 +221,11 @@
module SinatraHelpers
UTF8_ENCODING = Encoding.find('UTF-8')
ISO88591_ENCODING = Encoding.find('ISO-8859-1')
BINARY_ENCODING = Encoding.find('BINARY')
- # :nocov:
RACK_FILES = defined?(Rack::Files) ? Rack::Files : Rack::File
- # :nocov:
# Depend on the status_303 plugin.
def self.load_dependencies(app, _opts = nil)
app.plugin :status_303
end
@@ -349,13 +345,11 @@
file = RACK_FILES.new nil
s, h, b = if Rack.release > '2'
file.serving(self, path)
else
- # :nocov:
file.path = path
file.serving(@env)
- # :nocov:
end
res.status = opts[:status] || s
headers.delete("Content-Length")
headers.replace(h.merge!(headers))