Class: StartCommand

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

Instance Method Summary collapse

Constructor Details

#initialize(meta_config_file, runner, view, eval_loop_commands) ⇒ StartCommand

Returns a new instance of StartCommand.



7
8
9
10
11
12
# File 'lib/commands/start_command.rb', line 7

def initialize meta_config_file, runner, view, eval_loop_commands
	@runner = runner
	@view = view
	@meta_file = meta_config_file
	@eval_loop_commands = eval_loop_commands
end

Instance Method Details

#accepts_shell_command?(command) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/commands/start_command.rb', line 29

def accepts_shell_command? command
	command == 'start'
end

#continue_test_loop?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/commands/start_command.rb', line 33

def continue_test_loop?
	true
end

#execute_from_shell(params) ⇒ Object



14
15
16
# File 'lib/commands/start_command.rb', line 14

def execute_from_shell params
	start params[1], params[2]
end

#start(command, file) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/commands/start_command.rb', line 18

def start command, file
	unless command then @view.show_missing_command_argument_error "start", "shell_command"; return end
	if file then @view.show_deprecated_command_argument_warning "start", "kata_file" end # since 30-may-2011, remove argument in later version
  @view.show_start_kata command, file, @meta_file.framework_property
	@runner.source_files = @meta_file.source_files
  @runner.run_command = command
  scheduler = Scheduler.new @runner
  scheduler.interrupt_listener = SchedulerInterruptListener.new @view, @eval_loop_commands
  scheduler.start
end