Module: Mn2sts
- Defined in:
- lib/mn2sts.rb,
lib/mn2sts/version.rb
Constant Summary collapse
- MN2STS_JAR_PATH =
File.join(File.dirname(__FILE__), "../bin/mn2sts.jar")
- MN2STS_JAR_VERSION =
'1.8'
- VERSION =
"#{MN2STS_JAR_VERSION}.0"
Class Method Summary collapse
- .convert(xml_path_in, xml_path_out, opts = {}) ⇒ Object
- .help ⇒ Object
- .jvm_options ⇒ Object
- .version ⇒ Object
Class Method Details
.convert(xml_path_in, xml_path_out, opts = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/mn2sts.rb', line 29 def self.convert(xml_path_in, xml_path_out, opts = {}) return if xml_path_in.nil? || xml_path_out.nil? cmd = ["java", "-Xss5m", "-Xmx1024m", *, "-jar", MN2STS_JAR_PATH, "--xml-file-in", xml_path_in, "--xml-file-out", xml_path_out].join(" ") cmd += " --output-format iso" if opts[:iso] puts cmd _, error_str, status = Open3.capture3(cmd) unless status.success? warn error_str raise error_str end end |
.help ⇒ Object
17 18 19 20 21 |
# File 'lib/mn2sts.rb', line 17 def self.help cmd = ["java", *, "-jar", MN2STS_JAR_PATH].join(" ") , = Open3.capture3(cmd) end |
.jvm_options ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/mn2sts.rb', line 7 def self. = [] if RbConfig::CONFIG["host_os"].match?(/darwin|mac os/) << "-Dapple.awt.UIElement=true" end end |
.version ⇒ Object
23 24 25 26 27 |
# File 'lib/mn2sts.rb', line 23 def self.version cmd = ["java", *, "-jar", MN2STS_JAR_PATH, "-v"].join(" ") , = Open3.capture3(cmd) .strip end |