class Betterdoc::Generators::AppGenerator
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
# File lib/betterdoc/generators/app_generator.rb, line 32 def initialize(*args) super source_paths.unshift([File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'templates'))]) end
source_root(path = nil)
click to toggle source
# File lib/betterdoc/generators/app_generator.rb, line 14 def source_root(path = nil) Rails::Generators::AppGenerator.source_root(path) end
start(options)
click to toggle source
Calls superclass method
# File lib/betterdoc/generators/app_generator.rb, line 18 def start(options) options.push("--skip-action-cable") unless options.include?("--enable-action-cable") options.push("--skip-javascript") unless options.include?("--enable-javascript") options.push("--skip-sprockets") unless options.include?("--enable-sprockets") options.push("--skip-yarn") unless options.include?("--enable-yarn") options.push("--skip-action-mailer") unless options.include?("--enable-action-mailer") options.push("--skip-active-storage") unless options.include?("--enable-action-storage") options.push("--skip-spring") unless options.include?("--enable-spring") options.push("--skip-coffee") unless options.include?("--enable-coffee") options.push("--skip-test") unless options.include?("--enable-test") super(options) end
Public Instance Methods
create_misc_files()
click to toggle source
# File lib/betterdoc/generators/app_generator.rb, line 41 def create_misc_files template('env.development.local', '.env.development.local') template('dockerignore', '.dockerignore') template('rspec', '.rspec') template('rubocop.yml', '.rubocop.yml') template('Dockerfile', 'Dockerfile') template('circleci-config', '.circleci/config.yml') end
create_servicefile()
click to toggle source
# File lib/betterdoc/generators/app_generator.rb, line 54 def create_servicefile servicefile = Betterdoc::Support::Servicefile.new servicefile.service_name = @app_name servicefile.add_environment('PORT', 'The HTTP port on which the service should listen for incoming requests') servicefile.add_environment('SECRET_KEY_BASE', 'The Rails secret key base string') servicefile end
create_servicefile_file()
click to toggle source
# File lib/betterdoc/generators/app_generator.rb, line 50 def create_servicefile_file create_file('Servicefile', create_servicefile.to_yaml) end
get_builder_class()
click to toggle source
# File lib/betterdoc/generators/app_generator.rb, line 37 def get_builder_class AppBuilder end