Class: StartCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/flote/start_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(runner, view) ⇒ StartCommand



5
6
7
8
# File 'lib/flote/start_command.rb', line 5

def initialize runner, view
  @runner = runner
  @view = view
end

Instance Method Details

#accepts_shell_command?(command) ⇒ Boolean



23
24
25
# File 'lib/flote/start_command.rb', line 23

def accepts_shell_command? command
  command == 'start'
end

#execute_from_shell(params) ⇒ Object



10
11
12
# File 'lib/flote/start_command.rb', line 10

def execute_from_shell params
  start params[1]
end

#start(command) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/flote/start_command.rb', line 14

def start command
  unless command then @view.show_missing_command_argument_error "start", "shell_command"; return end
  @view.show_start command
  @runner.source_files = '.*'
  @runner.run_command = command
  scheduler = Scheduler.new @runner
  scheduler.start
end