Class: Isomorfeus::Installer::Target::Web

Inherits:
Object
  • Object
show all
Extended by:
DSL
Defined in:
lib/isomorfeus/installer/target/web.rb

Class Method Summary collapse

Methods included from DSL

config_path, copy_file, create_common_framework_directories, create_directory, create_file_from_template, install_basic_components, install_basic_policy, install_rake_file, install_spec_files

Class Method Details

.executeObject



8
9
10
11
12
13
14
# File 'lib/isomorfeus/installer/target/web.rb', line 8

def execute
  install_roda_app
  install_configuration
  install_web_loaders
  install_web_layouts
  install_web_specs unless Isomorfeus::Installer.project_name == 'test_app'
end

.install_configurationObject



27
28
29
30
# File 'lib/isomorfeus/installer/target/web.rb', line 27

def install_configuration
  create_file_from_template(templates_path, Isomorfeus::Installer.rack_server[:config_template], config_path(Isomorfeus::Installer.rack_server[:config_template][0..-5]), {})
  data_hash = { app_class: Isomorfeus::Installer.app_class }
end

.install_roda_appObject

DSL



18
19
20
21
22
23
24
25
# File 'lib/isomorfeus/installer/target/web.rb', line 18

def install_roda_app
  data_hash = { roda_app_class: Isomorfeus::Installer.roda_app_class, app_class: Isomorfeus::Installer.app_class }
  create_file_from_template(templates_path, 'roda_app.rb.erb', File.join('app', 'server', Isomorfeus::Installer.roda_app_path + '.rb'), data_hash)
  data_hash = { roda_app_class: Isomorfeus::Installer.roda_app_class, roda_app_path: Isomorfeus::Installer.roda_app_path }
  create_file_from_template(templates_path, 'config.ru.erb', 'config.ru', data_hash)
  create_file_from_template(templates_path, File.join('app_loader.rb.erb'), 'app_loader.rb', {})
  create_file_from_template(templates_path, File.join('.gitignore.erb'), '.gitignore', {})
end

.install_web_layoutsObject



32
33
34
35
# File 'lib/isomorfeus/installer/target/web.rb', line 32

def install_web_layouts
  copy_file(File.join(templates_path, 'web.mustache.erb'), File.join('app', 'layouts', 'web.mustache'))
  copy_file(File.join(templates_path, 'mail_preview.mustache.erb'), File.join('app', 'layouts', 'mail_preview.mustache'))
end

.install_web_loadersObject



37
38
39
40
41
# File 'lib/isomorfeus/installer/target/web.rb', line 37

def install_web_loaders
  create_file_from_template(templates_path, 'isomorfeus_loader.rb.erb', File.join('app', 'isomorfeus_loader.rb'), {})
  # create_file_from_template(templates_path, 'web_worker_loader.rb.erb', File.join('app', 'web_worker_loader.rb'), {})
  create_file_from_template(templates_path, 'mail_loader.rb.erb', File.join('app', 'mail_loader.rb'), {})
end

.install_web_specsObject



43
44
45
# File 'lib/isomorfeus/installer/target/web.rb', line 43

def install_web_specs
  create_file_from_template(templates_path, 'web_spec.rb.erb', File.join('spec', 'web_spec.rb'), {})
end

.templates_pathObject



47
48
49
# File 'lib/isomorfeus/installer/target/web.rb', line 47

def templates_path
  Isomorfeus::Installer.templates_path
end