Class: Plasma::CLI
- Inherits:
-
Thor
- Object
- Thor
- Plasma::CLI
- Defined in:
- lib/plasma/cli.rb
Overview
CLI interface for the plasma-mcp gem
Instance Method Summary collapse
- #auth ⇒ Object
- #console ⇒ Object
- #generate(type, name, *parameters) ⇒ Object
- #new(name) ⇒ Object
- #server(path = nil) ⇒ Object
- #version ⇒ Object
Instance Method Details
#auth ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/plasma/cli.rb', line 39 def auth puts "Engaging local authentication system..." # Start the auth server with options auth = Auth.new() auth.start end |
#console ⇒ Object
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/plasma/cli.rb', line 48 def console require "debug" # Load the application so we can use it in the console if we need to require_relative "loader" _application = Plasma::Loader.load_project # Start an interactive console binding.irb # rubocop:disable Lint/Debugger end |
#generate(type, name, *parameters) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/plasma/cli.rb', line 66 def generate(type, name, *parameters) # Parse parameters into a hash params = {} parameters.each do |param| key, value = param.split(":") params[key] = value if key && value end # Create the generator generator = ComponentGenerator.new(type, name, params) generator.generate end |
#new(name) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/plasma/cli.rb', line 12 def new(name) generator = Generator.new(name, ) generator.generate return if [:skip_git] Dir.chdir(name) do system("git init .") end end |