class MoshGenerator::AppGenerator

Override Rails default AppGenerator.

Public Class Methods

banner() click to toggle source

Banner for the cli.

Public Instance Methods

create_application_structure() click to toggle source

Create the minimal application structure.

# File lib/mosh_generator/generators/app_generator.rb, line 78
def create_application_structure
  build :create_helpers
  build :create_layout
  build :create_partial_views
  build :configure_grunt
end
create_configuration_files() click to toggle source

Creates some configuration files for tools.

# File lib/mosh_generator/generators/app_generator.rb, line 62
def create_configuration_files
  build :create_editorconfig_file
  build :create_ruby_version_file
  build :create_ruby_gemset_file
end
create_staging_environment() click to toggle source

Creates a staging environment

# File lib/mosh_generator/generators/app_generator.rb, line 71
def create_staging_environment
  build :create_staging_environment_file
end
finish_template() click to toggle source

Overrides default implementation to run customization code.

Calls superclass method
# File lib/mosh_generator/generators/app_generator.rb, line 35
def finish_template
  invoke :mosh_generator_customization
  super
end
mosh_generator_customization() click to toggle source

Customized generator wrapper.

# File lib/mosh_generator/generators/app_generator.rb, line 43
def mosh_generator_customization
  invoke :remove_files_we_dont_need
  invoke :create_configuration_files
  invoke :create_staging_environment
  invoke :create_application_structure
end
remove_files_we_dont_need() click to toggle source

Do some clean up.

# File lib/mosh_generator/generators/app_generator.rb, line 53
def remove_files_we_dont_need
  build :remove_public_index
  build :remove_assets_directories
  build :remove_doc_directory
end
run_bundle() click to toggle source

Override the original run_bundle to do nothing.

# File lib/mosh_generator/generators/app_generator.rb, line 88
def run_bundle
  bundle_command 'install --without production staging'
end

Protected Instance Methods

get_builder_class() click to toggle source

Override get_builder_class to get builder class from MoshGenerator module.

@return [MoshGenerator::AppBuilder] Mosh Generator’s AppBuilder implementation.

# File lib/mosh_generator/generators/app_generator.rb, line 99
def get_builder_class
  MoshGenerator::AppBuilder
end