lib/potassium/cli/commands/create.rb in potassium-2.3.0 vs lib/potassium/cli/commands/create.rb in potassium-3.0.0

- old
+ new

@@ -1,72 +1,19 @@ +require 'potassium/cli_options' + module Potassium::CLI + extend Potassium::CliOptions + desc "Create a new Potassium Rails project." arg 'app_path' command :create do |c| c.default_desc "Create a new project." c.switch "version-check", default_value: true, desc: "Performs a version check before running.", negatable: true - c.flag [:db, :database], - desc: "Decides which database to use. Available: mysql, postgresql, none" - c.flag "locale", - desc: "Decides which locale to use. Available: es-CL, en" - c.flag [:email_service, :email], - desc: "Decides which email adapter to use. Available: aws_ses, sendgrid, none" - c.switch "devise", - desc: "Whether to use Devise for authentication or not", - negatable: true, - default_value: "none" - c.switch "devise-user-model", - desc: "Whether to create a User model for Devise", - negatable: true, - default_value: "none" - c.switch "admin", - desc: "Whether to use ActiveAdmin or not", - negatable: true, - default_value: "none" - c.switch "angular-admin", - desc: "Whether to use Angular within ActiveAdmin or not", - negatable: true, - default_value: "none" - c.switch "pundit", - desc: "Whether to use Pundit for authorization or not", - negatable: true, - default_value: "none" - c.switch "api", - desc: "Whether to apply the API mode or not", - negatable: true, - default_value: "none" - c.switch "paperclip", - desc: "Whether to include Paperclip as dependency", - negatable: true, - default_value: "none" - c.switch "heroku", - desc: "Whether to prepare to application for Heroku or not", - negatable: true, - default_value: "none" - c.switch "delayed-job", - desc: "Whether to use DelayedJob or not", - negatable: true, - default_value: "none" - c.switch "github", - desc: "Whether to create a github repository", - negatable: true, - default_value: "none" - c.switch "github-private", - desc: "Whether to the github repository is private", - negatable: true, - default_value: false - c.switch "clockwork", - desc: "Whether to use clockwork as job scheduler", - negatable: true, - default_value: "none" - c.switch "sentry", - desc: "Whether to use Sentry as error reporting tool", - negatable: true, - default_value: "none" + create_options.each { |opts| c.send(opts.delete(:type), opts.delete(:name), opts) } c.action do |_global_options, options, _args| require "potassium/newest_version_ensurer" begin_creation = -> do