Class: Adhearsion::CLI::AhnCommand

Inherits:
Thor
  • Object
show all
Defined in:
lib/adhearsion/cli_commands/ahn_command.rb

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(action, *args) ⇒ Object (protected)

Raises:


76
77
78
79
# File 'lib/adhearsion/cli_commands/ahn_command.rb', line 76

def method_missing(action, *args)
  help
  raise UnknownCommand, [action, *args] * " "
end

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)

14
15
16
# File 'lib/adhearsion/cli_commands/ahn_command.rb', line 14

def self.exit_on_failure?
  true
end

Instance Method Details

#create(path) ⇒ Object


20
21
22
23
# File 'lib/adhearsion/cli_commands/ahn_command.rb', line 20

def create(path)
  require 'adhearsion/generators/app/app_generator'
  Generators::AppGenerator.start
end

#generate(generator_name = nil, *args) ⇒ Object


26
27
28
29
30
31
32
# File 'lib/adhearsion/cli_commands/ahn_command.rb', line 26

def generate(generator_name = nil, *args)
  if generator_name
    Generators.invoke generator_name
  else
    help 'generate'
  end
end

#start(path = nil) ⇒ Object


42
43
44
45
46
# File 'lib/adhearsion/cli_commands/ahn_command.rb', line 42

def start(path = nil)
  path = execute_from_app_dir! path
  say "Starting Adhearsion server at #{Dir.pwd}"
  Adhearsion::Initializer.start :console => !options[:noconsole]
end

#versionObject


35
36
37
38
# File 'lib/adhearsion/cli_commands/ahn_command.rb', line 35

def version
  say "Adhearsion v#{Adhearsion::VERSION}"
  exit 0
end