mn2sts 1.5.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a731737162d2cd2a0f62e7d37f63109242a6d006d0b45cd338884bcb76ada723
4
- data.tar.gz: 740e73cca5578e9fa070bee1c552bac45a023b35b8edfbbbec02196b6a49082f
3
+ metadata.gz: 84134e4826fac149e49b29741ebad354ac2e8d0b402e433aaa61c1af6d1d98c4
4
+ data.tar.gz: eecd2dfeddf705273eb3fc9b74429b3011c10f620f23cac835f1115d791652f9
5
5
  SHA512:
6
- metadata.gz: fe2c9acc24bc9f19aac580dfc4ebdb7ae48c48de8ac100005121aa88545d38363a558d7955107954bea300cb550db15bcca8d7bf7c7ec206354e8852fa219f8a
7
- data.tar.gz: 9f0835c4724f382cb04fddd730ee813ceda29fc9981fb8d944c02211e00a59ce4d0fa0e3bf55d1993914143eb2e61922af1d749045ab800399027e874beee48f
6
+ metadata.gz: 8d5d3bae86be38ea48e9edca1f5dd94ced9f282b15f43fa6a8cef1fc7dbaff2019e2994bd1a14e22171b70890f0eb04e8a60e2d02d0153e711b9c8fddacc2a02
7
+ data.tar.gz: d3ff1a5f058b4df8484abb3d089b2b42b2e0a7a915a347b52f1a3f112df26235ef1d2e9a7c50ca7ab807f23da1b6684642e37a128b8c7a59c32d0795c9e8978a
@@ -0,0 +1,42 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
9
+ pull_request:
10
+
11
+ jobs:
12
+ rake:
13
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
+ runs-on: ${{ matrix.os }}
15
+ continue-on-error: ${{ matrix.experimental }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: [ '2.7', '2.6', '2.5', '2.4' ]
20
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
21
+ experimental: [ false ]
22
+ include:
23
+ - ruby: '3.0'
24
+ os: 'ubuntu-latest'
25
+ experimental: true
26
+ - ruby: '3.0'
27
+ os: 'windows-latest'
28
+ experimental: true
29
+ - ruby: '3.0'
30
+ os: 'macos-latest'
31
+ experimental: true
32
+ steps:
33
+ - uses: actions/checkout@v2
34
+ with:
35
+ submodules: true
36
+
37
+ - uses: ruby/setup-ruby@v1
38
+ with:
39
+ ruby-version: ${{ matrix.ruby }}
40
+ bundler-cache: true
41
+
42
+ - run: bundle exec rake
@@ -20,7 +20,7 @@ jobs:
20
20
  env:
21
21
  mn2sts_TAG: ${{ github.event.client_payload.ref }}
22
22
  run: |
23
- echo "::set-env name=mn2sts_VERSION::${mn2sts_TAG#*/v}"
23
+ echo mn2sts_VERSION=${mn2sts_TAG#*/v} >> ${GITHUB_ENV}
24
24
  - name: Use Ruby
25
25
  uses: actions/setup-ruby@v1
26
26
  with:
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+ /.rubocop-http*
data/.rubocop.yml ADDED
@@ -0,0 +1,6 @@
1
+ # This project follows the Ribose OSS style guide.
2
+ # https://github.com/riboseinc/oss-guides
3
+ # All project-specific additions and overrides should be specified in this file.
4
+
5
+ inherit_from:
6
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
data/README.adoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = mn2sts Ruby gem
2
2
 
3
- image:https://img.shields.io/gem/v/metanorma.svg["Gem Version", link="https://rubygems.org/gems/metanorma"]
3
+ image:https://img.shields.io/gem/v/mn2sts.svg["Gem Version", link="https://rubygems.org/gems/mn2sts"]
4
4
  image:https://github.com/metanorma/mn2sts-ruby/workflows/ubuntu/badge.svg["Ubuntu Build Status", link="https://github.com/metanorma/mn2sts-ruby/actions?query=workflow%3Aubuntu"]
5
5
  image:https://github.com/metanorma/mn2sts-ruby/workflows/macos/badge.svg["OSX Build Status", link="https://github.com/metanorma/mn2sts-ruby/actions?query=workflow%3Amacos"]
6
6
  image:https://github.com/metanorma/mn2sts-ruby/workflows/windows/badge.svg["Windows Build Status", link="https://github.com/metanorma/mn2sts-ruby/actions?query=workflow%3Awindows"]
data/bin/mn2sts.jar CHANGED
Binary file
data/lib/mn2sts.rb CHANGED
@@ -1,29 +1,36 @@
1
- require 'open3'
2
- require 'mn2sts/version'
1
+ require "open3"
2
+ require "mn2sts/version"
3
3
 
4
4
  module Mn2sts
5
- MN2STS_JAR_PATH = File.join(File.dirname(__FILE__), '../bin/mn2sts.jar')
5
+ MN2STS_JAR_PATH = File.join(File.dirname(__FILE__), "../bin/mn2sts.jar")
6
+
7
+ def self.jvm_options
8
+ options = []
9
+
10
+ if RbConfig::CONFIG["host_os"].match?(/darwin|mac os/)
11
+ options << "-Dapple.awt.UIElement=true"
12
+ end
13
+
14
+ options
15
+ end
6
16
 
7
17
  def self.help
8
- cmd = ['java', '-jar', MN2STS_JAR_PATH].join(' ')
9
- message, error_str, status = Open3.capture3(cmd)
18
+ cmd = ["java", *jvm_options, "-jar", MN2STS_JAR_PATH].join(" ")
19
+ message, = Open3.capture3(cmd)
10
20
  message
11
21
  end
12
22
 
13
23
  def self.version
14
- cmd = ['java', '-jar', MN2STS_JAR_PATH, '-v'].join(' ')
15
- message, error_str, status = Open3.capture3(cmd)
24
+ cmd = ["java", *jvm_options, "-jar", MN2STS_JAR_PATH, "-v"].join(" ")
25
+ message, = Open3.capture3(cmd)
16
26
  message.strip
17
27
  end
18
28
 
19
29
  def self.convert(xml_path_in, xml_path_out, opts = {})
20
30
  return if xml_path_in.nil? || xml_path_out.nil?
21
31
 
22
- puts MN2STS_JAR_PATH
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(' ')
32
+ cmd = ["java", "-Xss5m", "-Xmx1024m", *jvm_options, "-jar", MN2STS_JAR_PATH,
33
+ "--xml-file-in", xml_path_in, "--xml-file-out", xml_path_out].join(" ")
27
34
 
28
35
  cmd += " --output-format iso" if opts[:iso]
29
36
 
@@ -35,5 +42,4 @@ module Mn2sts
35
42
  raise error_str
36
43
  end
37
44
  end
38
-
39
45
  end
@@ -1,4 +1,4 @@
1
1
  module Mn2sts
2
- MN2STS_JAR_VERSION = '1.5'
2
+ MN2STS_JAR_VERSION = '1.7'
3
3
  VERSION = "#{MN2STS_JAR_VERSION}.0"
4
4
  end
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.5.0
4
+ version: 1.7.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-08-31 00:00:00.000000000 Z
11
+ date: 2021-04-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  mn2sts converts Metanorma XML into NISO STS XML.
@@ -20,13 +20,12 @@ executables: []
20
20
  extensions: []
21
21
  extra_rdoc_files: []
22
22
  files:
23
- - ".github/workflows/macos.yml"
23
+ - ".github/workflows/rake.yml"
24
24
  - ".github/workflows/release-tag.yml"
25
25
  - ".github/workflows/release.yml"
26
- - ".github/workflows/ubuntu.yml"
27
- - ".github/workflows/windows.yml"
28
26
  - ".gitignore"
29
27
  - ".rspec"
28
+ - ".rubocop.yml"
30
29
  - CODE_OF_CONDUCT.md
31
30
  - Gemfile
32
31
  - README.adoc
@@ -56,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
55
  - !ruby/object:Gem::Version
57
56
  version: '0'
58
57
  requirements: []
59
- rubygems_version: 3.0.3
58
+ rubygems_version: 3.1.4
60
59
  signing_key:
61
60
  specification_version: 4
62
61
  summary: mn2sts converts Metanorma XML into NISO STS XML.
@@ -1,39 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: macos
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- pull_request:
9
- paths-ignore:
10
- - .github/workflows/ubuntu.yml
11
- - .github/workflows/windows.yml
12
-
13
- jobs:
14
- test-macos:
15
- name: Test on Ruby ${{ matrix.ruby }} macOS
16
- runs-on: macos-latest
17
- continue-on-error: ${{ matrix.experimental }}
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- ruby: [ '2.6', '2.5', '2.4' ]
22
- experimental: [false]
23
- include:
24
- - ruby: '2.7'
25
- experimental: true
26
- steps:
27
- - uses: actions/checkout@master
28
- - name: Use Ruby
29
- uses: actions/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby }}
32
- architecture: 'x64'
33
- - name: Update gems
34
- run: |
35
- sudo gem install bundler --force
36
- bundle install --jobs 4 --retry 3
37
- - name: Run specs
38
- run: |
39
- bundle exec rake
@@ -1,53 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: ubuntu
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- tags:
9
- - '*'
10
- pull_request:
11
- paths-ignore:
12
- - .github/workflows/macos.yml
13
- - .github/workflows/windows.yml
14
-
15
- jobs:
16
- test-linux:
17
- name: Test on Ruby ${{ matrix.ruby }} Ubuntu
18
- runs-on: ubuntu-latest
19
- continue-on-error: ${{ matrix.experimental }}
20
- strategy:
21
- fail-fast: false
22
- matrix:
23
- ruby: [ '2.6', '2.5', '2.4' ]
24
- experimental: [false]
25
- include:
26
- - ruby: '2.7'
27
- experimental: true
28
- steps:
29
- - uses: actions/checkout@master
30
- - name: Use Ruby
31
- uses: actions/setup-ruby@v1
32
- with:
33
- ruby-version: ${{ matrix.ruby }}
34
- architecture: 'x64'
35
- - name: Update gems
36
- run: |
37
- gem install bundler
38
- bundle install --jobs 4 --retry 3
39
- - name: Run specs
40
- run: |
41
- bundle exec rake
42
- - name: Trigger dependent repositories
43
- if: github.ref == 'refs/heads/master' && matrix.ruby == '2.6'
44
- env:
45
- GH_USERNAME: ${{ secrets.PAT_USERNAME }}
46
- GH_ACCESS_TOKEN: ${{ secrets.PAT_TOKEN }}
47
- run: |
48
- curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/trigger-gh-actions.sh
49
- [[ -f ".github/workflows/dependent_repos.env" ]] && source .github/workflows/dependent_repos.env
50
- for repo in $DEPENDENT_REPOS
51
- do
52
- sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "{ \"ref\": \"${GITHUB_REF}\" }"
53
- done
@@ -1,41 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: windows
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- pull_request:
9
- paths-ignore:
10
- - .github/workflows/macos.yml
11
- - .github/workflows/ubuntu.yml
12
-
13
- jobs:
14
- test-windows:
15
- name: Test on Ruby ${{ matrix.ruby }} Windows
16
- runs-on: windows-latest
17
- continue-on-error: ${{ matrix.experimental }}
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- ruby: [ '2.6', '2.5', '2.4' ]
22
- experimental: [false]
23
- include:
24
- - ruby: '2.7'
25
- experimental: true
26
- steps:
27
- - uses: actions/checkout@master
28
- - name: Use Ruby
29
- uses: actions/setup-ruby@v1
30
- with:
31
- ruby-version: ${{ matrix.ruby }}
32
- architecture: 'x64'
33
- - name: Update gems
34
- shell: pwsh
35
- run: |
36
- gem install bundler
37
- bundle config --local path vendor/bundle
38
- bundle install --jobs 4 --retry 3
39
- - name: Run specs
40
- run: |
41
- bundle exec rake