Class: Boto::Commands::Tasks

Inherits:
Object
  • Object
show all
Defined in:
lib/boto/commands/tasks.rb

Constant Summary collapse

COMMAND_WHITELIST =
%w(console server runner new version)

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Tasks

Returns a new instance of Tasks.



6
7
8
# File 'lib/boto/commands/tasks.rb', line 6

def initialize(argv)
  @args = argv
end

Instance Method Details

#consoleObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/boto/commands/tasks.rb', line 16

def console
  set_application_directory!

  require APP_PATH
  Dir.chdir(Boto.application.root)

  require "pry" rescue nil
  if defined? Pry
    Pry.start
  else
    require "irb"
    IRB.start
  end
end

#newObject



47
48
# File 'lib/boto/commands/tasks.rb', line 47

def new
end

#run_command!(command) ⇒ Object



10
11
12
13
14
# File 'lib/boto/commands/tasks.rb', line 10

def run_command!(command)
  command = parse_command(command)

  send(command) if COMMAND_WHITELIST.include?(command)
end

#runnerObject



44
45
# File 'lib/boto/commands/tasks.rb', line 44

def runner
end

#serverObject



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/boto/commands/tasks.rb', line 31

def server
  set_application_directory!
  require_command!("server")

  Boto::Server.new.tap do |server|
    # We need to require application after the server sets environment,
    # otherwise the --environment option given to the server won't propagate.
    require APP_PATH
    Dir.chdir(Boto.application.root)
    server.start
  end
end

#versionObject



50
51
# File 'lib/boto/commands/tasks.rb', line 50

def version
end