Method: Jets::CLI#lookup

Defined in:
lib/jets/cli.rb

#lookup(full_command) ⇒ Object

  1. look up Thor tasks

  2. look up Rake tasks

  3. help menu with all commands when both Thor and Rake tasks are not found



132
133
134
135
136
137
138
139
140
141
142
# File 'lib/jets/cli.rb', line 132

def lookup(full_command)
  thor_task_found = Jets::Commands::Base.namespaced_commands.include?(full_command)
  if thor_task_found
    return Jets::Commands::Base.klass_from_namespace(namespace)
  end

  rake_task_found = Jets::Commands::RakeCommand.namespaced_commands.include?(full_command)
  if rake_task_found
    return Jets::Commands::RakeCommand
  end
end