Class: Sublayer::Commands::NewProject
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Sublayer::Commands::NewProject
- Includes:
- Thor::Actions
- Defined in:
- lib/sublayer/cli/commands/new_project.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.banner ⇒ Object
20 21 22 |
# File 'lib/sublayer/cli/commands/new_project.rb', line 20 def self. "sublayer new PROJECT_NAME" end |
.source_root ⇒ Object
16 17 18 |
# File 'lib/sublayer/cli/commands/new_project.rb', line 16 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#create_project ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/sublayer/cli/commands/new_project.rb', line 24 def create_project @project_template = [:template] || ask("Select a project template:", default: "CLI", limited_to: %w[CLI GithubAction QuickScript]) case @project_template.downcase when 'cli' invoke Commands::CLIProject, [project_name], when 'githubaction', 'github_action' invoke Commands::GithubActionProject, [project_name], when 'quickscript', 'quick_script' invoke Commands::QuickScriptProject, [project_name], else say "Unknown project template: #{@project_template}", :red exit 1 end end |