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

- old
+ new

@@ -16,16 +16,18 @@ add_git_templates end def template_options { - app_name: app_name, - hanami_head: hanami_head?, - test: test_framework.framework, - database: database_config.type, - database_config: database_config.to_hash, - hanami_model_version: hanami_model_version, + project_name: project_name, + 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 @@ -34,18 +36,16 @@ 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('lib/project.rb.tt', "lib/#{ project_name }.rb") end def add_test_templates if test_framework.rspec? add_mapping('Rakefile.rspec.tt', 'Rakefile') @@ -61,16 +61,16 @@ end def add_empty_directories add_mapping('.gitkeep', 'public/.gitkeep') add_mapping('.gitkeep', 'config/initializers/.gitkeep') - add_mapping('.gitkeep', "lib/#{ app_name }/entities/.gitkeep") - add_mapping('.gitkeep', "lib/#{ app_name }/repositories/.gitkeep") - add_mapping('.gitkeep', "lib/#{ app_name }/mailers/.gitkeep") - add_mapping('.gitkeep', "lib/#{ app_name }/mailers/templates/.gitkeep") - add_mapping('.gitkeep', "spec/#{ app_name }/entities/.gitkeep") - add_mapping('.gitkeep', "spec/#{ app_name }/repositories/.gitkeep") - add_mapping('.gitkeep', "spec/#{ app_name }/mailers/.gitkeep") + add_mapping('.gitkeep', "lib/#{ project_name }/entities/.gitkeep") + add_mapping('.gitkeep', "lib/#{ project_name }/repositories/.gitkeep") + add_mapping('.gitkeep', "lib/#{ project_name }/mailers/.gitkeep") + add_mapping('.gitkeep', "lib/#{ project_name }/mailers/templates/.gitkeep") + add_mapping('.gitkeep', "spec/#{ project_name }/entities/.gitkeep") + add_mapping('.gitkeep', "spec/#{ project_name }/repositories/.gitkeep") + add_mapping('.gitkeep', "spec/#{ project_name }/mailers/.gitkeep") add_mapping('.gitkeep', 'spec/support/.gitkeep') if database_config.sql? add_mapping('.gitkeep', 'db/migrations/.gitkeep') else