bin/tork in tork-16.0.0 vs bin/tork in tork-17.0.0

- old
+ new

@@ -1,9 +1,9 @@ #!/usr/bin/env ruby =begin -TORK 1 2012-01-25 16.0.0 +TORK 1 2012-01-27 17.0.0 ============================================================================== NAME ------------------------------------------------------------------------------ @@ -49,27 +49,25 @@ #----------------------------------------------------------------------------- require 'tork/client' warn 'tork: Absorbing test execution overhead...' -@driver = Tork::Client::Transceiver.new('tork-driver') do |line| - evstr, *details = JSON.load(line) - event = evstr.to_sym - - case event +@driver = Tork::Client::Transceiver.new('tork-driver') do |event, *details| + case event_sym = event.to_sym when :load then warn 'tork: Overhead absorbed. Ready for testing!' when :over then warn 'tork: Reabsorbing changed overhead files...' else - test_file, line_numbers, *details = details - message = [evstr.upcase, test_file, line_numbers.inspect, details].join(' ') + test_file, line_numbers, log_file, worker_number, exit_status = details + message = [event.upcase, [test_file, *line_numbers].join(':'), + exit_status].compact.join(' ') - color = case event + color = case event_sym when :pass then "\e[34m%s\e[0m" # blue when :fail then "\e[31m%s\e[0m" # red end message = color % message if color and STDOUT.tty? - message = [message, File.read(test_file + '.log'), message] if event == :fail + message = [message, File.read(log_file), message] if event_sym == :fail puts message end end @@ -85,10 +83,10 @@ 'o' => :reabsorb_overhead_files, 'q' => :quit, } begin - while key = STDIN.gets.chomp + while key = STDIN.gets.strip if command = COMMANDS[key] warn "tork: Sending #{command.to_s.inspect} command..." @driver.send [command] break if command == :quit else # invalid command