Class: Maglev::CreateSiteCommand
- Inherits:
-
Rails::Command::Base
- Object
- Rails::Command::Base
- Maglev::CreateSiteCommand
- Defined in:
- lib/commands/maglev/create_site_command.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.banner(_command = nil) ⇒ Object
9 10 11 |
# File 'lib/commands/maglev/create_site_command.rb', line 9 def self.(_command = nil, *) 'bin/rails maglev:create_site' end |
Instance Method Details
#perform ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/commands/maglev/create_site_command.rb', line 13 def perform require File.('config/environment') if Maglev::Site.exists? say '🤔 You already have a site. 🤔', :yellow return end Maglev::GenerateSite.call( theme: Maglev.local_themes.first ) say '🎉 Your site has been created with success!' end |