Class: RailsForge::WizardTUI
- Inherits:
-
Object
- Object
- RailsForge::WizardTUI
- Defined in:
- lib/railsforge/wizard_tui.rb
Overview
WizardTUI - Interactive TUI wizard
Constant Summary collapse
- PROJECT_TYPES =
Available project types mapped to profiles
{ "standard" => { name: "Standard", description: "Basic Rails application", profile: "standard" }, "blog" => { name: "Blog", description: "Content blog with articles and comments", profile: "blog" }, "admin_app" => { name: "Admin App", description: "Admin dashboard with CRUD operations", profile: "admin_app" }, "api_only" => { name: "API-Only", description: "RESTful API with JWT authentication", profile: "api_only" }, "saas" => { name: "SaaS", description: "Full-featured SaaS with auth, admin, payments", profile: "standard" } }.freeze
- AVAILABLE_FEATURES =
Available features/generators
%w[ services queries jobs forms presenters policies serializers mailers features apis components stimulus ].freeze
- AVAILABLE_ANALYZERS =
Available analyzers
%w[ controllers models specs database metrics security performance ].freeze
Instance Method Summary collapse
-
#initialize ⇒ WizardTUI
constructor
Initialize wizard.
-
#run ⇒ Object
Main execution method.
Constructor Details
#initialize ⇒ WizardTUI
Initialize wizard
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/railsforge/wizard_tui.rb', line 29 def initialize # Lazy-load TTY dependencies require 'tty-prompt' require 'tty-table' @prompt = TTY::Prompt.new = { project_name: nil, project_type: nil, template_version: nil, features: [], analyzers: [], dry_run: false } end |
Instance Method Details
#run ⇒ Object
Main execution method
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/railsforge/wizard_tui.rb', line 46 def run puts "" puts "🚀 Welcome to RailsForge Wizard!".color(:green) puts "=" * 50 puts "" # Step 1: Project name ask_project_name # Step 2: Project type select_project_type # Step 3: Template version select_template_version # Step 4: Features select_features # Step 5: Analyzers select_analyzers # Step 6: Dry-run option ask_dry_run # Step 7: Summary and confirmation confirm_and_run end |