Module: MnConvert
- Defined in:
- lib/mnconvert.rb,
lib/mnconvert/version.rb
Defined Under Namespace
Modules: InputFormat
Constant Summary collapse
- MNCONVERT_JAR_PATH =
File.join(File.dirname(__FILE__), "../bin/mnconvert.jar")
- VERSION =
"1.9.0"
- MNCONVERT_JAR_VERSION =
VERSION
Class Method Summary collapse
- .convert(input_file, output_file, input_format, opts = {}) ⇒ Object
- .help ⇒ Object
- .jvm_options ⇒ Object
- .version ⇒ Object
Class Method Details
.convert(input_file, output_file, input_format, opts = {}) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/mnconvert.rb', line 34 def self.convert(input_file, output_file, input_format, opts = {}) validate(opts, input_format) cmd = ["java", *, "-jar", MNCONVERT_JAR_PATH, input_file, "--input-format", input_format, "--output", output_file, *optional_opts(opts)].join(" ") puts cmd if opts[:debug] output_str, error_str, status = Open3.capture3(cmd) p output_str if opts[:debug] unless status.success? raise error_str end end |
.help ⇒ Object
22 23 24 25 26 |
# File 'lib/mnconvert.rb', line 22 def self.help cmd = ["java", *, "-jar", MNCONVERT_JAR_PATH].join(" ") , = Open3.capture3(cmd) end |
.jvm_options ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/mnconvert.rb', line 12 def self. = ["-Xss5m", "-Xmx1024m"] if RbConfig::CONFIG["host_os"].match?(/darwin|mac os/) << "-Dapple.awt.UIElement=true" end end |
.version ⇒ Object
28 29 30 31 32 |
# File 'lib/mnconvert.rb', line 28 def self.version cmd = ["java", *, "-jar", MNCONVERT_JAR_PATH, "-v"].join(" ") , = Open3.capture3(cmd) .strip end |