Class: Sublayer::Commands::GithubActionProject
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Sublayer::Commands::GithubActionProject
- Includes:
- Thor::Actions
- Defined in:
- lib/sublayer/cli/commands/github_action_project.rb
Instance Attribute Summary collapse
-
#ai_provider_key ⇒ Object
readonly
Returns the value of attribute ai_provider_key.
Class Method Summary collapse
Instance Method Summary collapse
- #ask_for_project_details ⇒ Object
- #copy_template_files ⇒ Object
- #create_project_directory ⇒ Object
- #finalize_project ⇒ Object
- #generate_configuration ⇒ Object
- #print_next_steps ⇒ Object
- #sublayer_version ⇒ Object
Instance Attribute Details
#ai_provider_key ⇒ Object (readonly)
Returns the value of attribute ai_provider_key.
4 5 6 |
# File 'lib/sublayer/cli/commands/github_action_project.rb', line 4 def ai_provider_key @ai_provider_key end |
Class Method Details
.source_root ⇒ Object
13 14 15 |
# File 'lib/sublayer/cli/commands/github_action_project.rb', line 13 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#ask_for_project_details ⇒ Object
21 22 23 24 |
# File 'lib/sublayer/cli/commands/github_action_project.rb', line 21 def ask_for_project_details @ai_provider = [:provider] || ask("Select an AI provider:", default: "OpenAI", limited_to: %w[OpenAI Claude Gemini]) @ai_model = [:model] || select_ai_model end |
#copy_template_files ⇒ Object
32 33 34 35 36 |
# File 'lib/sublayer/cli/commands/github_action_project.rb', line 32 def copy_template_files say "Copying template files", :green directory "../templates/github_action", ".github/workflows" end |
#create_project_directory ⇒ Object
26 27 28 29 30 |
# File 'lib/sublayer/cli/commands/github_action_project.rb', line 26 def create_project_directory say "Creating project directory", :green empty_directory ".github/workflows" end |
#finalize_project ⇒ Object
43 44 45 |
# File 'lib/sublayer/cli/commands/github_action_project.rb', line 43 def finalize_project end |
#generate_configuration ⇒ Object
39 40 41 |
# File 'lib/sublayer/cli/commands/github_action_project.rb', line 39 def generate_configuration end |
#print_next_steps ⇒ Object
47 48 49 50 51 52 |
# File 'lib/sublayer/cli/commands/github_action_project.rb', line 47 def print_next_steps say "\nSublayer Github Action Project '#{project_name}' created successfully!", :green say "To get started: " say "Create some Sublayer Actions and Sublayer generators within '.github/workflows/#{project_name}/{actions/,generators/}'" say "And edit the file at '.github/workflows/#{project_name}.yml' to set up what you want the action triggered by" end |