Dear all,
When a template file path is apps/web/templates/books/index.html.erb, some editor (e.g. emacs, jstar) generates backup file with tilde(~) as index.html.erb~ at the same directory.
Hanami server looks recognize *.erb~ also correspond to some engine, but finally it fails as follows:
Boot Error
Something went wrong while loading …bookshelf/config.ru
RuntimeError: No template engine registered for index.html.erb~
/usr/local/lib/ruby/gems/2.5.0/gems/hanami-1.2.0/lib/hanami/components/components.rb:474:inmodule_eval' /usr/local/lib/ruby/gems/2.5.0/gems/tilt-2.0.8/lib/tilt.rb:43:in
new’
…
I found that this error is because at hanami-view-1.2.0/lib/hanami/view/rendering/templates_finder.rb templates_path globs as follows and default engines is defined as ‘*’ so that backup file *.erb~ is also selected:
def templates_path(*parts)
Dir.glob("#{ parts.join(separator) }.#{ format }.#{ engines }")
end
Could anybody let me know how to narrow engines only to ‘erb’ rather than ‘*’, or ignore tilde(~)?
Thank you!