Sha256: c2f4813ccae7edd0140d1d7579d5d64052d8576f1008e2da245727a3a5c35cd9
Contents?: true
Size: 1 KB
Versions: 70
Compression:
Stored size: 1 KB
Contents
require "isodoc" require "mnconvert" module IsoDoc module Iso class StsConvert < IsoDoc::XslfoPdfConvert def initialize(_options) # rubocop:disable Lint/MissingSuper @libdir = File.dirname(__FILE__) @format = :sts @suffix = "sts.xml" end def inputfile(in_fname, filename) /\.xml$/.match?(in_fname) or in_fname = Tempfile.open([filename, ".xml"], encoding: "utf-8") do |f| f.write file f.path end in_fname end def convert(in_fname, file = nil, debug = false, out_fname = nil) file = File.read(in_fname, encoding: "utf-8") if file.nil? _docxml, filename, dir = convert_init(file, in_fname, debug) in_fname = inputfile(in_fname, filename) FileUtils.rm_rf dir MnConvert.convert(in_fname, { input_format: MnConvert::InputFormat::MN, output_file: out_fname || "#{filename}.#{@suffix}" }) end end end end
Version data entries
70 entries across 70 versions & 1 rubygems