Module: Mn2pdf

Defined in:
lib/tebako-runtime/adapters/mn2pdf.rb,
lib/tebako-runtime/adapters/mn2pdf.rb,
lib/tebako-runtime/adapters/mn2pdf.rb

Overview

options_to_cmd's joined form (--param "k=v" in ONE shell word) is shell-string machinery; the array spawn takes flag and value as separate elements with the shell quotes removed. Stock behavior stands for the PATH java.

Constant Summary collapse

MN2PDF_JAR_PATH =
TebakoRuntime::MN2PDF_J_PATH

Class Method Summary collapse

Class Method Details

.convert(url_path, output_path, xsl_stylesheet, options) ⇒ Object



53
54
55
56
# File 'lib/tebako-runtime/adapters/mn2pdf.rb', line 53

def self.convert(url_path, output_path, xsl_stylesheet, options)
  convert_orig(TebakoRuntime.extract_memfs(url_path), output_path, TebakoRuntime.extract_memfs(xsl_stylesheet),
               options)
end

.options_to_cmd(options, cmd) ⇒ Object



93
94
95
96
97
98
99
100
101
102
103
# File 'lib/tebako-runtime/adapters/mn2pdf.rb', line 93

def self.options_to_cmd(options, cmd)
  return options_to_cmd_orig(options, cmd) if TebakoRuntime.mounted_exe("openjdk", "java") == "java"

  options.each do |k, v|
    if k.to_s.end_with?("=")
      cmd << "#{k}#{v.to_s.delete('"')}"
    else
      cmd << k.to_s << v.to_s.delete('"')
    end
  end
end