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

respond_with tried to require every engine Tilt knows about #1172

Closed
ericroberts opened this issue Aug 18, 2016 · 7 comments · Fixed by #1558
Closed

respond_with tried to require every engine Tilt knows about #1172

ericroberts opened this issue Aug 18, 2016 · 7 comments · Fixed by #1558

Comments

@ericroberts
Copy link

When it does Tilt[engine] in template_for, it tries to require the engine, but most of them are not installed.

@ericroberts
Copy link
Author

Downgrading tilt to 1.4 makes it work for now.

@zzak
Copy link
Member

zzak commented Aug 19, 2016

@ericroberts Can you provide a reproducible script?

@markpitchless
Copy link

I just came across the same issue, template_for trying to require all engines.

Worked around it by forcing it to only search the engines I'm using:

settings.template_engines[:all] = [:erb]

Using sinatra and contrib 1.4.7 with tilt 2.0.5. Triggered by:

require 'sinatra'
require 'sinatra/respond_with'
get '/' do
  respond_with :index
end
curl -v -H "Accept: text/html" 'http://localhost:4567/'

Looks like this bit of code in respond_with.rb:

          # not exactly like Tilt[engine], but does not trigger a require
          if Tilt.respond_to?(:mappings)
            klass = Tilt.mappings[Tilt.normalize(engine)].first
          else
            klass = Tilt[engine]
          end

The current tilt doesn't seem to have a mappings or normalize method anymore.

@zzak
Copy link
Member

zzak commented Jan 30, 2017

Could someone with context on this open an issue on tilt to see if there is a workaround/alternative?

@zzak zzak added the feedback label Jan 30, 2017
@mwpastore
Copy link
Member

Go ahead and assign it to me if you'd like, I'll see what I can work out with them.

@zzak
Copy link
Member

zzak commented Jan 30, 2017

@mwpastore 🙇

@namusyaka namusyaka added this to the v2.0.2 milestone Feb 19, 2018
@namusyaka
Copy link
Member

@mwpastore Any progress on this?

@namusyaka namusyaka modified the milestones: v2.0.2, v2.0.3, v2.0.4 Jun 5, 2018
@namusyaka namusyaka modified the milestones: v2.0.4, v2.0.5 Sep 14, 2018
@namusyaka namusyaka modified the milestones: v2.0.5, v2.0.6 Dec 22, 2018
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Mar 20, 2020
Update ruby-sinatra to 2.0.8.1.


## 2.0.8.1 / 2020-01-02

* Allow multiple hashes to be passed in `merge` and `merge!` for `Sinatra::IndifferentHash` [#1572](sinatra/sinatra#1572) by Shota Iguchi

## 2.0.8 / 2020-01-01

* Lookup Tilt class for template engine without loading files [#1558](sinatra/sinatra#1558). Fixes [#1172](sinatra/sinatra#1172) by Jordan Owens

* Add request info in NotFound exception [#1566](sinatra/sinatra#1566) by Stefan Sundin

* Add `.yaml` support in `Sinatra::Contrib::ConfigFile` [#1564](sinatra/sinatra#1564). Fixes [#1563](sinatra/sinatra#1563) by Emerson Manabu Araki

* Remove only routing parameters from @params hash [#1569](sinatra/sinatra#1569). Fixes [#1567](sinatra/sinatra#1567) by Jordan Owens, Horacio

* Support `capture` and `content_for` with Hamlit [#1580](sinatra/sinatra#1580) by Takashi Kokubun

* Eliminate warnings of keyword parameter for Ruby 2.7.0 [#1581](sinatra/sinatra#1581) by Osamtimizer

## 2.0.7 / 2019-08-22

* Fix a regression [#1560](sinatra/sinatra#1560) by Kunpei Sakai

## 2.0.6 / 2019-08-21

* Fix an issue setting environment from command line option [#1547](sinatra/sinatra#1547), [#1554](sinatra/sinatra#1554) by Jordan Owens, Kunpei Sakai

* Support pandoc as a new markdown renderer [#1533](sinatra/sinatra#1533) by Vasiliy

* Remove outdated code for tilt 1.x [#1532](sinatra/sinatra#1532) by Vasiliy

* Remove an extra logic for `force_encoding` [#1527](sinatra/sinatra#1527) by Jordan Owens

* Avoid multiple errors even if `params` contains special values [#1526](sinatra/sinatra#1527) by Kunpei Sakai

* Support `bundler/inline` with `require 'sinatra'` integration [#1520](sinatra/sinatra#1520) by Kunpei Sakai

* Avoid `TypeError` when params contain a key without a value on Ruby < 2.4 [#1516](sinatra/sinatra#1516) by Samuel Giddins

* Improve development support and documentation and source code by  Olle Jonsson, Basavanagowda Kanur, Yuki MINAMIYA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants