Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove outdated code for Tilt 1.x versions #1532

Merged
merged 4 commits into from
Jun 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Deprecate tilt 1.x support for sinatra-contrib
  • Loading branch information
304 committed May 1, 2019
commit c4ec8837cb6d97a778843247c23fe64939e0d4e8
14 changes: 5 additions & 9 deletions sinatra-contrib/lib/sinatra/respond_with.rb
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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