Add --template-engine option to hanami new#390
Conversation
|
ℹ️ Optional job failed: Ruby jruby |
f930060 to
73d7041
Compare
This option takes "erb", "haml" or "slim" and: - Adds a gem entry to Gemfile, if not erb - Sets default_template_engine in config/app.rb - Creates the app layout with the selected template engine
73d7041 to
1a73aed
Compare
hanami new
timriley
left a comment
There was a problem hiding this comment.
Looking good! Just left you a couple notes about things that might be good to change. Keen for your feedback.
|
|
||
| module <%= camelized_app_name %> | ||
| class App < Hanami::App | ||
| <%- if template_engine != "erb" -%> |
There was a problem hiding this comment.
We should make this (and probably all similar output changes in this PR) conditional on --skip-view not being given.
(In other words, if --skip-view is passed, we should just ignore the --template-engine option)
There was a problem hiding this comment.
Also a good point, thanks! I was wondering if we should warned the user that they are using a combination of options that does not make sense, but perhaps this is just obvious and there's no point in that. What do you think?
There was a problem hiding this comment.
I think for now we can just handle it internally. If --skip-view is given, it can "win" and we can just ignore any other view related flags.
There was a problem hiding this comment.
Great. So are we good to go here?
There was a problem hiding this comment.
Should these files technically be called app_layout.haml.erb (yo dawg, I heard you like template engines)
At least this would signify that we're using templating inside them, and would make it consistent with our other .erb templates.
There was a problem hiding this comment.
Yes, this is a good point 👍
fb896cd to
e783287
Compare
Follow up to #389. Now you can pass
--template-engineoption tohanami newand it will be respected.This option takes "erb", "haml" or "slim" and: