mn2sts 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +1 -1
- data/Rakefile +14 -1
- data/bin/mn2sts.jar +0 -0
- data/lib/mn2sts.rb +7 -5
- data/lib/mn2sts/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fda5bec5cc90aeea99c4d5169fca93291add45bebd703abc8d94473f72ca3335
|
4
|
+
data.tar.gz: bc69ab1b9b6f265f6d0288b282137bde9aae0f0ca437503a680bba3f7e32f376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baf1fc414a34895a7b255b0469b3bd1135485e5f865bf6bb5c5db275065e54345ef3418f92caaa04e0cb53de9aa450ac6ac7116b7644577a9752ebe764e570df
|
7
|
+
data.tar.gz: 633c5a4a135faa648463ebbcecb1c2b754b9700a8d546f0c13dcfb0693e136658ee4b4e750eb3a302fa5eabc911275362a10dd26952eb9dcd7f3f1e74cbd021e
|
data/README.adoc
CHANGED
data/Rakefile
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
2
|
require 'rspec/core/rake_task'
|
3
3
|
require_relative 'lib/mn2sts/version'
|
4
|
+
require 'open-uri'
|
4
5
|
|
5
6
|
RSpec::Core::RakeTask.new(:spec)
|
6
7
|
|
7
|
-
task :default => :spec
|
8
|
+
task :default => ['bin/mn2sts.jar', 'spec/fixtures/rice-en.cd.mn.xml', :spec]
|
8
9
|
|
9
10
|
require 'open-uri'
|
10
11
|
|
@@ -15,3 +16,15 @@ file 'bin/mn2sts.jar' do |file|
|
|
15
16
|
file.write open(url).read
|
16
17
|
end
|
17
18
|
end
|
19
|
+
|
20
|
+
file 'spec/fixtures/rice-en.cd.mn.xml' do |file|
|
21
|
+
uri = "https://raw.githubusercontent.com/metanorma/mn-samples-iso/gh-pages/documents/international-standard/rice-en.cd.xml"
|
22
|
+
|
23
|
+
File.open(file.name, "w") do |saved_file|
|
24
|
+
# the following "open" is provided by open-uri
|
25
|
+
open(uri, "r") do |read_file|
|
26
|
+
saved_file.write(read_file.read)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
data/bin/mn2sts.jar
CHANGED
Binary file
|
data/lib/mn2sts.rb
CHANGED
@@ -16,18 +16,20 @@ module Mn2sts
|
|
16
16
|
message.strip
|
17
17
|
end
|
18
18
|
|
19
|
-
def self.convert(
|
20
|
-
return if
|
19
|
+
def self.convert(xml_path_in, xml_path_out)
|
20
|
+
return if xml_path_in.nil? || xml_path_out.nil?
|
21
21
|
|
22
22
|
puts MN2STS_JAR_PATH
|
23
|
-
cmd = ['java', '-Xss5m', '-Xmx1024m', '-jar', MN2STS_JAR_PATH,
|
24
|
-
|
25
|
-
|
23
|
+
cmd = ['java', '-Xss5m', '-Xmx1024m', '-jar', MN2STS_JAR_PATH,
|
24
|
+
'--xml-file-in', xml_path_in,
|
25
|
+
'--xml-file-out', xml_path_out
|
26
|
+
].join(' ')
|
26
27
|
|
27
28
|
puts cmd
|
28
29
|
_, error_str, status = Open3.capture3(cmd)
|
29
30
|
|
30
31
|
unless status.success?
|
32
|
+
warn error_str
|
31
33
|
raise error_str
|
32
34
|
end
|
33
35
|
end
|
data/lib/mn2sts/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mn2sts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
mn2sts converts Metanorma XML into NISO STS XML.
|
@@ -56,7 +56,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
requirements: []
|
59
|
-
|
59
|
+
rubyforge_project:
|
60
|
+
rubygems_version: 2.7.6
|
60
61
|
signing_key:
|
61
62
|
specification_version: 4
|
62
63
|
summary: mn2sts converts Metanorma XML into NISO STS XML.
|