From 8e128967050fd8f6d33f9ba61a54b81cf901a019 Mon Sep 17 00:00:00 2001 From: Max Pleaner Date: Fri, 19 Aug 2016 15:51:45 -0700 Subject: [PATCH] Remove dependency on `Tilt.mappings` method With Sinatra versions newer than 1.4.0, `Tilt.mappings` does not exist. Not sure what effect this method had in the first place, but making it return early if `Tilt.mappings` is not defined does not seem to break anything for me. --- lib/sinatra/assetpack.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/sinatra/assetpack.rb b/lib/sinatra/assetpack.rb index 4231177..94f458c 100644 --- a/lib/sinatra/assetpack.rb +++ b/lib/sinatra/assetpack.rb @@ -15,6 +15,8 @@ def self.supported_formats # Returns a map of what MIME format each Tilt type returns. def self.tilt_formats + # Early return to prevent this method from causing errors on Sinatra > 1.4.0 + return {} unless Tilt.respond_to?(:mappings) @formats ||= begin hash = Hash.new Tilt.mappings.each do |format, (engine, _)|