Class: Hanami::Commands::New::Container

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

Constant Summary collapse

DEFAULT_APPLICATION_NAME =
'web'.freeze

Constants inherited from Abstract

Abstract::DEFAULT_APPLICATION_BASE_URL, 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

#initialize, #start

Methods included from Generators::Generatable

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

Constructor Details

This class inherits a constructor from Hanami::Commands::New::Abstract

Instance Method Details

#map_templatesObject



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

def map_templates
  add_application_templates
  add_empty_directories
  add_test_templates
  add_sql_templates
  add_git_templates
end

#post_process_templatesObject



33
34
35
36
# File 'lib/hanami/commands/new/container.rb', line 33

def post_process_templates
  init_git
  generate_app
end

#template_optionsObject



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

def template_options
  {
    project_name:         project_name,
    hanami_head:          hanami_head?,
    code_reloading:       code_reloading?,
    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