lib/hanami/commands/new/app.rb in hanami-0.7.3 vs lib/hanami/commands/new/app.rb in hanami-0.8.0

- old
+ new

@@ -17,19 +17,21 @@ add_git_templates end def template_options { - app_name: app_name, - upcase_app_name: upcase_app_name, - classified_app_name: classified_app_name, - application_base_url: application_base_url, - hanami_head: hanami_head?, - test: test_framework.framework, - database: database_config.type, - database_config: database_config.to_hash, - hanami_model_version: hanami_model_version, + app_name: app_name, + upcase_app_name: upcase_app_name, + classified_app_name: classified_app_name, + application_base_url: application_base_url, + hanami_head: hanami_head?, + test: test_framework.framework, + database: database_config.type, + database_config: database_config.to_hash, + hanami_model_version: hanami_model_version, + hanami_version: hanami_version, + template: template_engine.name } end def post_process_templates init_git @@ -37,22 +39,20 @@ private def add_application_templates add_mapping('hanamirc.tt', '.hanamirc') - add_mapping('.env.tt', '.env') add_mapping('.env.development.tt', '.env.development') add_mapping('.env.test.tt', '.env.test') add_mapping('Gemfile.tt', 'Gemfile') add_mapping('config.ru.tt', 'config.ru') add_mapping('config/environment.rb.tt', 'config/environment.rb') add_mapping('lib/app_name.rb.tt', "lib/#{ app_name }.rb") - add_mapping('lib/config/mapping.rb.tt', 'lib/config/mapping.rb') add_mapping('config/application.rb.tt', 'config/application.rb') add_mapping('config/routes.rb.tt', 'config/routes.rb') add_mapping('views/application_layout.rb.tt', 'app/views/application_layout.rb') - add_mapping('templates/application.html.erb.tt', 'app/templates/application.html.erb') + add_mapping("templates/application.html.#{ template_engine.name }.tt", "app/templates/application.html.#{ template_engine.name }") add_mapping('favicon.ico', 'app/assets/favicon.ico') end def add_test_templates if test_framework.rspec? @@ -105,12 +105,10 @@ def classified_app_name Utils::String.new(app_name).classify.tr('::', '') end - # def application_base_path - # [ 'apps', app_name ].join(::File::SEPARATOR) - # end + alias app_name project_name end end end end