Quote URL passed to a2png

This commit is contained in:
Marcin Kulik 2017-01-11 16:10:55 +01:00
parent da8a313898
commit c89d363c9f

View File

@ -5,7 +5,7 @@ class Rasterizer
BINARY_PATH = (Rails.root + "a2png" + "a2png.sh").to_s BINARY_PATH = (Rails.root + "a2png" + "a2png.sh").to_s
def generate_image(asciicast_url, out_path, time) def generate_image(asciicast_url, out_path, time)
o, e, t = Open3.capture3("#{BINARY_PATH} #{asciicast_url} #{out_path} #{time}") o, e, t = Open3.capture3("#{BINARY_PATH} '#{asciicast_url}' #{out_path} #{time}")
if t.exitstatus != 0 if t.exitstatus != 0
raise RuntimeError, "Couldn't generate image from #{asciicast_url}:\n#{o}\n#{e}" raise RuntimeError, "Couldn't generate image from #{asciicast_url}:\n#{o}\n#{e}"