bin/shellrecord in shellplay-0.0.5 vs bin/shellrecord in shellplay-0.0.6
- old
+ new
@@ -85,11 +85,11 @@
'displaycommand' => displaycommand,
'playprompt' => playprompt,
'clearscreen' => clearscreen,
'customprompt' => customprompt,
'stdin' => command,
- 'stdout' => out,
+ 'stdout' => out.chomp,
'stderr' => '',
'timespent' => 0
})
else
start_time = Time.now
@@ -97,17 +97,18 @@
screen = Shellplay::Screen.new
out = o.read
err = e.read
end_time = Time.now
elapsed = end_time - start_time
+ stdin = displaycommand ? command : ""
session.add_screen({
'displaycommand' => displaycommand,
'playprompt' => playprompt,
'clearscreen' => clearscreen,
'customprompt' => customprompt,
- 'stdin' => command,
- 'stdout' => out,
- 'stderr' => err,
+ 'stdin' => stdin,
+ 'stdout' => out.chomp,
+ 'stderr' => err.chomp,
'timespent' => elapsed
})
out.split("\n").each do |line|
puts line
end