Class: Hanami::Commands::New::App

Inherits:
Abstract
  • Object
show all
Defined in:
lib/hanami/commands/new/app.rb

Constant Summary

Constants inherited from Abstract

Hanami::Commands::New::Abstract::DEFAULT_APPLICATION_BASE_URL, Hanami::Commands::New::Abstract::DEFAULT_ARCHITECTURE

Instance Attribute Summary

Attributes inherited from Abstract

#database_config, #hanami_model_version, #options, #target_path, #template_engine, #test_framework

Instance Method Summary collapse

Methods inherited from Abstract

#start

Methods included from Generators::Generatable

#add_mapping, #argument_blank?, #destroy, #generator, #process_templates, #start, #target_path

Constructor Details

#initialize(options, name) ⇒ App

Returns a new instance of App.



8
9
10
# File 'lib/hanami/commands/new/app.rb', line 8

def initialize(options, name)
  super(options, name)
end

Instance Method Details

#map_templatesObject



12
13
14
15
16
17
18
# File 'lib/hanami/commands/new/app.rb', line 12

def map_templates
  add_application_templates
  add_empty_directories
  add_test_templates
  add_sql_templates
  add_git_templates
end

#post_process_templatesObject



36
37
38
# File 'lib/hanami/commands/new/app.rb', line 36

def post_process_templates
  init_git
end

#template_optionsObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/hanami/commands/new/app.rb', line 20

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,
    hanami_version:       hanami_version,
    template:             template_engine.name
  }
end