Skip to content

Commit

Permalink
Deprecate tilt 1.x support for sinatra-contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
304 committed May 1, 2019
1 parent 9f6c262 commit c4ec883
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 5 additions & 9 deletions sinatra-contrib/lib/sinatra/respond_with.rb
Expand Up @@ -173,16 +173,12 @@ def template_for(name, exts)
settings.template_engines[ext].each { |e| possible << [e, name] }
end
possible.each do |engine, template|
# not exactly like Tilt[engine], but does not trigger a require
if Tilt.respond_to?(:mappings)
klass = Tilt.mappings[Tilt.normalize(engine)].first
else
begin
klass = Tilt[engine]
rescue LoadError
next
end
begin
klass = Tilt[engine]
rescue LoadError
next
end

find_template(settings.views, template, klass) do |file|
next unless File.exist? file
return settings.rendering_method(engine) << template.to_sym
Expand Down
2 changes: 1 addition & 1 deletion sinatra-contrib/sinatra-contrib.gemspec
Expand Up @@ -39,7 +39,7 @@ EOF
s.add_dependency "sinatra", version
s.add_dependency "mustermann", "~> 1.0"
s.add_dependency "backports", ">= 2.8.2"
s.add_dependency "tilt", ">= 1.3", "< 3"
s.add_dependency "tilt", "~> 2.0"
s.add_dependency "rack-protection", version
s.add_dependency "multi_json"

Expand Down

0 comments on commit c4ec883

Please sign in to comment.