Class: Sublayer::Commands::GithubActionProject

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/sublayer/cli/commands/github_action_project.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ai_provider_keyObject (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_rootObject



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_detailsObject



21
22
23
24
# File 'lib/sublayer/cli/commands/github_action_project.rb', line 21

def ask_for_project_details
  @ai_provider = options[:provider] || ask("Select an AI provider:", default: "OpenAI", limited_to: %w[OpenAI Claude Gemini])
  @ai_model = options[:model] || select_ai_model
end

#copy_template_filesObject



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_directoryObject



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_projectObject



43
44
45
# File 'lib/sublayer/cli/commands/github_action_project.rb', line 43

def finalize_project

end

#generate_configurationObject



39
40
41
# File 'lib/sublayer/cli/commands/github_action_project.rb', line 39

def generate_configuration

end


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

#sublayer_versionObject



17
18
19
# File 'lib/sublayer/cli/commands/github_action_project.rb', line 17

def sublayer_version
  Sublayer::VERSION
end