class Dry::Web::WebPipe::Generators::SubApp

Public Instance Methods

populate_templates() click to toggle source
# File lib/dry/web/web_pipe/generators/sub_app.rb, line 8
def populate_templates
  add_lib
  add_system
  add_web
end

Private Instance Methods

add_lib() click to toggle source
# File lib/dry/web/web_pipe/generators/sub_app.rb, line 36
def add_lib
  add_template('subapp/web.rb.tt', "#{lib_path}/web.rb")
  add_template('subapp/root.rb.tt', "#{lib_path}/actions/root.rb")
  add_template('subapp/view_context.rb.tt', "#{lib_path}/view_context.rb")
  add_template('subapp/view.rb.tt', "#{lib_path}/view.rb")
  add_template('subapp/welcome.rb.tt', "#{lib_path}/views/welcome.rb")
end
add_system() click to toggle source
# File lib/dry/web/web_pipe/generators/sub_app.rb, line 44
def add_system
  add_template("subapp/router.rb.tt", "#{system_lib_path}/router.rb")
  add_template('subapp/container.rb.tt', "#{system_lib_path}/container.rb")
  add_template('subapp/import.rb.tt', "#{system_lib_path}/import.rb")
  add_template('subapp/boot.rb.tt', 'system/boot.rb')
end
add_web() click to toggle source
# File lib/dry/web/web_pipe/generators/sub_app.rb, line 51
def add_web
  add_template('application.html.slim', 'web/templates/layouts/application.html.slim')
  add_template('welcome.html.slim', 'web/templates/welcome.html.slim')
end
destination() click to toggle source
# File lib/dry/web/web_pipe/generators/sub_app.rb, line 16
def destination
  options.fetch(:to) { File.join("apps", target_dir) }
end
lib_path() click to toggle source
# File lib/dry/web/web_pipe/generators/sub_app.rb, line 28
def lib_path
  "lib/#{underscored_umbrella_name}/#{underscored_project_name}"
end
system_lib_path() click to toggle source
# File lib/dry/web/web_pipe/generators/sub_app.rb, line 32
def system_lib_path
  "system/#{underscored_umbrella_name}/#{underscored_project_name}"
end
template_scope() click to toggle source
# File lib/dry/web/web_pipe/generators/sub_app.rb, line 56
def template_scope
  {
    underscored_project_name: underscored_project_name,
    camel_cased_app_name: Inflections.camel_cased_name(target_dir),
    underscored_umbrella_name: underscored_umbrella_name,
    camel_cased_umbrella_name: Inflections.camel_cased_name(umbrella_name),
  }
end
umbrella_name() click to toggle source
# File lib/dry/web/web_pipe/generators/sub_app.rb, line 20
def umbrella_name
  options.fetch(:umbrella)
end
underscored_umbrella_name() click to toggle source
# File lib/dry/web/web_pipe/generators/sub_app.rb, line 24
def underscored_umbrella_name
  Inflections.underscored_name(umbrella_name)
end