Class: Rsg::Generators::App::AppBuilder

Inherits:
Rails::AppBuilder
  • Object
show all
Defined in:
lib/rsg/generators/app/app_builder.rb

Overview

The application builder allows you to override elements of the application generator without being forced to reverse the operations of the default generator.

This allows you to override entire operations, like the creation of the Gemfile, README, or JavaScript files, without needing to know exactly what those operations do so you can create another template action.

For Rails 6.1, you can check out github.com/rails/rails/blob/6-1-stable/railties/lib/rails/generators/rails/app/app_generator.rb#L44

Instance Method Summary collapse

Instance Method Details

#readmeObject

Simple template overwrites



17
18
19
# File 'lib/rsg/generators/app/app_builder.rb', line 17

def readme
  template "README.md.erb", "README.md"
end

#ruby_versionObject

Things to skip since we don’t care about them



25
26
27
28
# File 'lib/rsg/generators/app/app_builder.rb', line 25

def ruby_version
  # NOOP since we have the ruby version in Gemfile and want it to be the
  # single source of truth
end