diff options
author | Patrick Simianer <p@simianer.de> | 2015-05-27 19:19:06 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2015-05-27 19:19:06 +0200 |
commit | 4e5ead06642714990b054ecf68f88b79dbd7b489 (patch) | |
tree | abdc8976504d48533daced3001fecc9eb469388e /server.rb | |
parent | e820e38159390093cdcbf08b2f1a8b7eb0632278 (diff) |
bits & pieces
Diffstat (limited to 'server.rb')
-rwxr-xr-x | server.rb | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -8,6 +8,7 @@ require 'digest' require_relative "#{ARGV[0]}" INPUT = ReadFile.readlines INPUT_FILE +INPUT_RAW = ReadFile.readlines RAW_INPUT_FILE `mkdir -p #{WORK_DIR}/g` def start_daemon cmd, name, addr @@ -102,6 +103,7 @@ get '/next' do STDERR.write "[extractor] < got '#{env[:extractor][:socket].recv}'\n" end source = INPUT.shift + raw_source = INPUT_RAW.shift if !source # input is done -> displays 'Thank you!' STDERR.write ">>> end of input, sending 'fi'\n" "fi" @@ -121,7 +123,7 @@ get '/next' do STDERR.write "[dtrain] waiting for translation ...\n" transl = env[:dtrain][:socket].recv.force_encoding "UTF-8" STDERR.write "[dtrain] < received translation: '#{transl}'\n" - "#{source}\t#{transl}" + "#{source}\t#{transl.strip}\t#{raw_source}" end end |