15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/timmy/runner.rb', line 15
def replay_log(log)
basename = File.basename(log)
match = log.match(/timmy-(?<time>\d+)\+\d+.log/)
time = match[:time].to_i
MasterTimer.start(time)
lines = File.readlines(log)
lines.each do |line|
if match = line.match(/^(?<m>\d+):(?<s>\d+(\.\d+)?) \| (?<content>.*)/)
content = match[:content]
time = match[:m].to_i * 60 + match[:s].to_f
MasterTimer.set(time)
run_line(content)
end
end
TargetedTimer.stop_all
Logger.finalize
end
|