Class: Hanami::Commands::Generate::App Private
- Defined in:
- lib/hanami/commands/generate/app.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #base_path ⇒ Object readonly private
Attributes inherited from Abstract
Instance Method Summary collapse
-
#initialize(options, application_name) ⇒ App
constructor
private
A new instance of App.
- #map_templates ⇒ Object private
- #post_process_templates ⇒ Object private
- #template_options ⇒ Object private
Methods inherited from Abstract
Methods included from Generators::Generatable
#add_mapping, #argument_blank?, #destroy, #generator, #process_templates, #start, #template_source_path
Methods inherited from Command
Constructor Details
#initialize(options, application_name) ⇒ App
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of App.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/hanami/commands/generate/app.rb', line 18 def initialize(, application_name) @environment = Hanami::Environment.new() @options = Hanami::Utils::Hash.new().symbolize! @target_path = Hanami.root assert_application_name!(application_name) assert_architecture! assert_application_base_url! @application_name = ApplicationName.new(application_name) @base_path = Pathname.pwd end |
Instance Attribute Details
#base_path ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/hanami/commands/generate/app.rb', line 15 def base_path @base_path end |
Instance Method Details
#map_templates ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/hanami/commands/generate/app.rb', line 33 def map_templates add_mapping('application.rb.tt', 'application.rb') add_mapping('config/routes.rb.tt', 'config/routes.rb') add_mapping('views/application_layout.rb.tt', 'views/application_layout.rb') add_mapping("templates/application.html.#{ template_engine.name }.tt", "templates/application.html.#{ template_engine.name }") add_mapping('favicon.ico', 'assets/favicon.ico') add_mapping('.gitkeep', 'controllers/.gitkeep') add_mapping('.gitkeep', 'assets/images/.gitkeep') add_mapping('.gitkeep', 'assets/javascripts/.gitkeep') add_mapping('.gitkeep', 'assets/stylesheets/.gitkeep') add_mapping('.gitkeep', "../../spec/#{ app_name }/features/.gitkeep") add_mapping('.gitkeep', "../../spec/#{ app_name }/controllers/.gitkeep") add_mapping('.gitkeep', "../../spec/#{ app_name }/views/.gitkeep") end |
#post_process_templates ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
62 63 64 65 66 |
# File 'lib/hanami/commands/generate/app.rb', line 62 def post_process_templates add_require_app add_mount_app add_web_session_secret end |
#template_options ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/hanami/commands/generate/app.rb', line 50 def { app_name: app_name, upcase_app_name: upcase_app_name, classified_app_name: classified_app_name, app_base_url: application_base_url, app_base_path: application_base_path, template: template_engine.name } end |