Class: NewBase::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/new_base/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#install_supabase_configObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/generators/new_base/install/install_generator.rb', line 13

def install_supabase_config
  say "🚀 Welcome to All About Dat Base - Supabase Configuration Generator!", :green
  say ""
  
  # Interactive environment selection
  prompt = TTY::Prompt.new
  
  environment_choice = prompt.select(
    "Which environments do you want to configure for Supabase?",
    [
      { name: "Development only", value: :development },
      { name: "Production only", value: :production },
      { name: "Both development and production", value: :both }
    ],
    symbols: { marker: "❯" }
  )
  
  say ""
  say "📝 Configuring database.yml for #{environment_choice}...", :blue
  
  # Generate database.yml based on selection
  generate_database_config(environment_choice)
  
  say ""
  say "✅ Database configuration updated!", :green
  say ""
  
  # Provide credentials instructions
  show_credentials_instructions
end