Class: Boto::Commands::Tasks
- Inherits:
-
Object
- Object
- Boto::Commands::Tasks
- Defined in:
- lib/boto/commands/tasks.rb
Constant Summary collapse
- COMMAND_WHITELIST =
%w(console server runner new version)
Instance Method Summary collapse
- #console ⇒ Object
-
#initialize(argv) ⇒ Tasks
constructor
A new instance of Tasks.
- #new ⇒ Object
- #run_command!(command) ⇒ Object
- #runner ⇒ Object
- #server ⇒ Object
- #version ⇒ Object
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
#console ⇒ Object
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 |
#new ⇒ Object
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 |
#runner ⇒ Object
44 45 |
# File 'lib/boto/commands/tasks.rb', line 44 def runner end |
#server ⇒ Object
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 |
#version ⇒ Object
50 51 |
# File 'lib/boto/commands/tasks.rb', line 50 def version end |