Class: Lotus::Commands::New::Abstract
Overview
Constant Summary
collapse
- DEFAULT_ARCHITECTURE =
'container'.freeze
- DEFAULT_APPLICATION_BASE_URL =
'/'.freeze
Instance Attribute Summary collapse
Instance Method Summary
collapse
#add_mapping, #destroy, #generator, #map_templates, #post_process_templates, #process_templates, #template_options, #template_source_path
Constructor Details
#initialize(options, name) ⇒ Abstract
Returns a new instance of Abstract.
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/lotus/commands/new/abstract.rb', line 20
def initialize(options, name)
@options = Lotus::Utils::Hash.new(options).symbolize!
@name = name
@options[:database] ||= Lotus::Generators::DatabaseConfig::DEFAULT_ENGINE
assert_options!
assert_name!
assert_architecture!
@lotus_model_version = '~> 0.5'
@database_config = Lotus::Generators::DatabaseConfig.new(options[:database], app_name)
end
|
Instance Attribute Details
#database_config ⇒ Object
18
19
20
|
# File 'lib/lotus/commands/new/abstract.rb', line 18
def database_config
@database_config
end
|
#options ⇒ Object
18
19
20
|
# File 'lib/lotus/commands/new/abstract.rb', line 18
def options
@options
end
|
#target_path ⇒ Object
18
19
20
|
# File 'lib/lotus/commands/new/abstract.rb', line 18
def target_path
@target_path
end
|
Instance Method Details
#start ⇒ Object
33
34
35
36
37
38
39
40
|
# File 'lib/lotus/commands/new/abstract.rb', line 33
def start
FileUtils.mkdir_p(@name)
Dir.chdir(@name) do
@target_path = Pathname.pwd
super
end
end
|