rtomayko / tilt

Generic interface to multiple Ruby template engines

Home Page:http://github.com/rtomayko/tilt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Opal support outdated

joep opened this issue · comments

commented

Opal seems to have restructured their code and there no longer seems to be any tilt support baked in. Opal::Processor went away at some point.

That is, the following:

require 'opal'
require 'tilt'

Tilt.new 'a.rb'

results in:

/Users/joe/.rvm/gems/ruby-2.4.0/gems/tilt-2.0.10/lib/tilt/mapping.rb:246:in `eval': uninitialized constant Opal::Processor (NameError)
Did you mean?  Process
        from /Users/joe/.rvm/gems/ruby-2.4.0/gems/tilt-2.0.10/lib/tilt/mapping.rb:246:in `eval'
        from /Users/joe/.rvm/gems/ruby-2.4.0/gems/tilt-2.0.10/lib/tilt/mapping.rb:246:in `block in lazy_load'
        from /Users/joe/.rvm/gems/ruby-2.4.0/gems/tilt-2.0.10/lib/tilt/mapping.rb:241:in `each'
        from /Users/joe/.rvm/gems/ruby-2.4.0/gems/tilt-2.0.10/lib/tilt/mapping.rb:241:in `lazy_load'
        from /Users/joe/.rvm/gems/ruby-2.4.0/gems/tilt-2.0.10/lib/tilt/mapping.rb:216:in `lookup'
        from /Users/joe/.rvm/gems/ruby-2.4.0/gems/tilt-2.0.10/lib/tilt/mapping.rb:154:in `[]'
        from /Users/joe/.rvm/gems/ruby-2.4.0/gems/tilt-2.0.10/lib/tilt/mapping.rb:137:in `new'
        from /Users/joe/.rvm/gems/ruby-2.4.0/gems/tilt-2.0.10/lib/tilt.rb:43:in `new'

Agreed, we should probably remove the register_lazy for Opal::Processor.

commented

We have Tilt support, but Opal::Processor is part of opal-sprockets gem. In core, we have a class that doesn't require Sprockets, namely Opal::TiltTemplate: https://github.com/opal/opal/blob/master/lib/tilt/opal.rb

Anyway, I think it's best to leave that choice to a developer.