Class: Templet::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Templet::InstallGenerator
show all
- Includes:
- Shared::CoreHelpers
- Defined in:
- lib/generators/templet/install/install_generator.rb
Constant Summary
collapse
- CONTROLLER_SUBDIR =
'controllers/'
- APIS_SUBDIR =
'apis/'
- LAYOUTS =
'/layouts'
- DESC =
DEST_DESC = ‘The directory that the app code will be copied beneath’ class_option :dest, type: :string, aliases: “-d”, default: ”, desc: DEST_DESC
"Add specs for the layouts (default: false)"
Shared::CoreHelpers::APP_ROOT, Shared::CoreHelpers::APP_SUBDIR, Shared::CoreHelpers::HELPERS_SUBDIR, Shared::CoreHelpers::LIB_ROOT, Shared::CoreHelpers::SOURCE_ROOT, Shared::CoreHelpers::SPEC_SUBDIR, Shared::CoreHelpers::SUPPORT_SUBDIR, Shared::CoreHelpers::TEMPLET_SUBDIR
Instance Method Summary
collapse
Instance Method Details
#create_app ⇒ Object
30
31
32
33
34
35
36
|
# File 'lib/generators/templet/install/install_generator.rb', line 30
def create_app
create_app_tree
create_app_rb
mount_engine
end
|
#create_rspec_support ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/generators/templet/install/install_generator.rb', line 38
def create_rspec_support
if rspec?
i(shared viewer).each do |subdir|
directory spec_support_dir_source(subdir), spec_support_dir_target
end
directory api_support_dir_source, api_support_dir_target
create_layout_specs if include_layout_specs?
end
end
|
#ensure_uninstalled ⇒ Object
22
23
24
25
26
27
28
|
# File 'lib/generators/templet/install/install_generator.rb', line 22
def ensure_uninstalled
if dir = already_installed_at
puts "Can't install while there are files present in #{dir}"
exit
end
end
|