Class: Suspenders::CLI
- Inherits:
-
Object
- Object
- Suspenders::CLI
- Defined in:
- lib/suspenders/cli.rb
Overview
Command-line interface for generating Rails applications with Suspenders. This class handles the creation of new Rails apps using a custom template and predefined configuration options.
Constant Summary collapse
- BASE_OPTIONS =
Base options passed to the Rails generator for all new applications. These options configure PostgreSQL as the database, skip test setup, and skip Solid-related features.
[ "-d=postgresql", "--skip-test", "--skip-solid" ]
Class Method Summary collapse
-
.run(app_name) ⇒ Boolean
Creates and runs a new CLI instance for the given application name.
Instance Method Summary collapse
-
#initialize(app_name) ⇒ CLI
constructor
Initializes a new CLI instance.
-
#run ⇒ Boolean
Executes the CLI workflow to generate a new Rails application.
Constructor Details
#initialize(app_name) ⇒ CLI
Initializes a new CLI instance.
20 21 22 |
# File 'lib/suspenders/cli.rb', line 20 def initialize(app_name) @app_name = app_name end |
Class Method Details
.run(app_name) ⇒ Boolean
Creates and runs a new CLI instance for the given application name.
29 30 31 |
# File 'lib/suspenders/cli.rb', line 29 def self.run(app_name) new(app_name).run end |
Instance Method Details
#run ⇒ Boolean
Executes the CLI workflow to generate a new Rails application. Verifies Rails installation and generates the app with Suspenders template.
38 39 40 41 |
# File 'lib/suspenders/cli.rb', line 38 def run verify_rails_exists! generate_new_rails_app end |