mn2pdf 1.20 → 1.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +63 -0
- data/.github/workflows/release.yml +1 -0
- data/README.adoc +5 -5
- data/bin/mn2pdf.jar +0 -0
- data/lib/mn2pdf.rb +6 -5
- data/lib/mn2pdf/version.rb +1 -1
- metadata +6 -8
- data/.github/workflows/macos.yml +0 -38
- data/.github/workflows/ubuntu.yml +0 -56
- data/.github/workflows/windows.yml +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10ca19db80d8efe03100f5ec676e5261938cdea9481099d0d15a4462eb60f29f
|
4
|
+
data.tar.gz: eb08e5eeb02c1466726eb04783f03280998600bafcd75345c4016b3a7b1af96c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '095b2c141920d8415378ad6b38974f2addbad14c56dddc52edd0c891ade38908720a07952dcad2dc58b492127c937829f67829382e70280a6cb24e9871637a3b'
|
7
|
+
data.tar.gz: 2a4a25fc19f95f06c031a5a097c11c7544c34cbe42548c787cb18bc7497671a89b7063caa935167409d05fbe3743239b5070503bd37c0f394d053bed8e7d5e10
|
@@ -0,0 +1,63 @@
|
|
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.6', '2.5', '2.4' ]
|
20
|
+
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
21
|
+
experimental: [ false ]
|
22
|
+
include:
|
23
|
+
- ruby: '2.7'
|
24
|
+
os: 'ubuntu-latest'
|
25
|
+
experimental: true
|
26
|
+
- ruby: '2.7'
|
27
|
+
os: 'windows-latest'
|
28
|
+
experimental: true
|
29
|
+
- ruby: '2.7'
|
30
|
+
os: 'macos-latest'
|
31
|
+
experimental: true
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@master
|
34
|
+
|
35
|
+
- uses: ruby/setup-ruby@v1
|
36
|
+
with:
|
37
|
+
ruby-version: ${{ matrix.ruby }}
|
38
|
+
|
39
|
+
- uses: actions/cache@v1
|
40
|
+
with:
|
41
|
+
path: vendor/bundle
|
42
|
+
key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
|
43
|
+
restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
|
44
|
+
|
45
|
+
- run: bundle config set path 'vendor/bundle'
|
46
|
+
|
47
|
+
- run: bundle install --jobs 4 --retry 3
|
48
|
+
|
49
|
+
- run: bundle exec rake
|
50
|
+
|
51
|
+
notify:
|
52
|
+
name: Trigger notify workflow
|
53
|
+
needs: rake
|
54
|
+
runs-on: ubuntu-latest
|
55
|
+
steps:
|
56
|
+
- name: Trigger notify workflow
|
57
|
+
uses: Sibz/github-status-action@v1
|
58
|
+
with:
|
59
|
+
authToken: ${{ secrets.GITHUB_TOKEN }}
|
60
|
+
context: 'tests-passed-successfully'
|
61
|
+
description: 'Tests passed successfully'
|
62
|
+
state: 'success'
|
63
|
+
sha: ${{ github.event.pull_request.head.sha || github.sha }}
|
data/README.adoc
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
= mn2pdf Ruby gem
|
2
2
|
|
3
|
-
image:https://img.shields.io/gem/v/
|
4
|
-
image:https://github.com/metanorma/mn2pdf-ruby/workflows/
|
5
|
-
image:https://github.com/metanorma/mn2pdf-ruby/workflows/macos/badge.svg["OSX Build Status", link="https://github.com/metanorma/mn2pdf-ruby/actions?query=workflow%3Amacos"]
|
6
|
-
image:https://github.com/metanorma/mn2pdf-ruby/workflows/windows/badge.svg["Windows Build Status", link="https://github.com/metanorma/mn2pdf-ruby/actions?query=workflow%3Awindows"]
|
3
|
+
image:https://img.shields.io/gem/v/mn2pdf.svg["Gem Version", link="https://rubygems.org/gems/mn2pdf"]
|
4
|
+
image:https://github.com/metanorma/mn2pdf-ruby/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/mn2pdf-ruby/actions?workflow=rake"]
|
7
5
|
image:https://codeclimate.com/github/metanorma/mn2pdf-ruby/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/mn2pdf-ruby"]
|
8
6
|
image:https://img.shields.io/github/issues-pr-raw/metanorma/mn2pdf-ruby.svg["Pull Requests", link="https://github.com/metanorma/mn2pdf-ruby/pulls"]
|
9
7
|
image:https://img.shields.io/github/commits-since/metanorma/mn2pdf-ruby/latest.svg["Commits since latest",link="https://github.com/metanorma/mn2pdf-ruby/releases"]
|
@@ -30,9 +28,11 @@ Or include it in your gemspec.
|
|
30
28
|
[source,ruby]
|
31
29
|
----
|
32
30
|
require 'mn2pdf'
|
33
|
-
Mn2pdf.convert(sample_xml_path, output_pdf_path, sample_xsl_path)
|
31
|
+
Mn2pdf.convert(sample_xml_path, output_pdf_path, sample_xsl_path, options = "")
|
34
32
|
----
|
35
33
|
|
34
|
+
The options are any options trailing in the mn2pdf Java executable, e.g. `--split-by-language`.
|
35
|
+
|
36
36
|
== Updating the gem
|
37
37
|
|
38
38
|
Update `lib/mn2pdf/version.rb` to the desired version of https://github.com/metanorma/mn2pdf[mn2pdf].
|
data/bin/mn2pdf.jar
CHANGED
Binary file
|
data/lib/mn2pdf.rb
CHANGED
@@ -16,20 +16,21 @@ module Mn2pdf
|
|
16
16
|
message.strip
|
17
17
|
end
|
18
18
|
|
19
|
-
def self.convert(url_path, output_path, xsl_stylesheet)
|
19
|
+
def self.convert(url_path, output_path, xsl_stylesheet, options = "")
|
20
20
|
return if url_path.nil? || output_path.nil? || xsl_stylesheet.nil?
|
21
21
|
|
22
22
|
puts MN2PDF_JAR_PATH
|
23
23
|
cmd = ['java', '-Xss5m', '-Xmx1024m', '-jar', MN2PDF_JAR_PATH, '--xml-file',
|
24
24
|
url_path, '--xsl-file', xsl_stylesheet, '--pdf-file',
|
25
|
-
output_path].join(' ')
|
25
|
+
output_path, options].join(' ')
|
26
26
|
|
27
27
|
puts cmd
|
28
|
-
|
28
|
+
stdout_str, error_str, status = Open3.capture3(cmd)
|
29
29
|
|
30
30
|
unless status.success?
|
31
|
-
|
31
|
+
# Strip default mn2pdf message
|
32
|
+
stdout_str = stdout_str.gsub('Preparing...', '').strip
|
33
|
+
raise [stdout_str, error_str].join(' ').strip
|
32
34
|
end
|
33
35
|
end
|
34
|
-
|
35
36
|
end
|
data/lib/mn2pdf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mn2pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.23'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
mn2pdf converts Metanorma XML into PDF.
|
@@ -20,11 +20,9 @@ executables: []
|
|
20
20
|
extensions: []
|
21
21
|
extra_rdoc_files: []
|
22
22
|
files:
|
23
|
-
- ".github/workflows/
|
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"
|
30
28
|
- CODE_OF_CONDUCT.md
|
@@ -41,7 +39,7 @@ homepage: https://github.com/metanorma/mn2pdf-ruby
|
|
41
39
|
licenses:
|
42
40
|
- BSD-2-Clause
|
43
41
|
metadata: {}
|
44
|
-
post_install_message:
|
42
|
+
post_install_message:
|
45
43
|
rdoc_options: []
|
46
44
|
require_paths:
|
47
45
|
- lib
|
@@ -57,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
55
|
version: '0'
|
58
56
|
requirements: []
|
59
57
|
rubygems_version: 3.0.3
|
60
|
-
signing_key:
|
58
|
+
signing_key:
|
61
59
|
specification_version: 4
|
62
60
|
summary: mn2pdf converts Metanorma XML into PDF.
|
63
61
|
test_files: []
|
data/.github/workflows/macos.yml
DELETED
@@ -1,38 +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
|
-
- name: Update gems
|
33
|
-
run: |
|
34
|
-
sudo gem install bundler --force
|
35
|
-
bundle install --jobs 4 --retry 3
|
36
|
-
- name: Run specs
|
37
|
-
run: |
|
38
|
-
bundle exec rake
|
@@ -1,56 +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
|
-
- name: Update gems
|
35
|
-
run: |
|
36
|
-
gem install bundler
|
37
|
-
bundle install --jobs 4 --retry 3
|
38
|
-
- name: Run specs
|
39
|
-
run: |
|
40
|
-
bundle exec rake
|
41
|
-
- name: Trigger repositories
|
42
|
-
if: matrix.ruby == '2.6'
|
43
|
-
env:
|
44
|
-
GH_USERNAME: metanorma-ci
|
45
|
-
GH_ACCESS_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
|
46
|
-
run: |
|
47
|
-
curl -LO --retry 3 https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/trigger-gh-actions.sh
|
48
|
-
[[ -f ".github/workflows/dependent_repos.env" ]] && source .github/workflows/dependent_repos.env
|
49
|
-
CLIENT_PAYLOAD=$(cat <<EOF
|
50
|
-
"{ "ref": "${GITHUB_REF}", "repo": "${GITHUB_REPOSITORY}" }"
|
51
|
-
EOF
|
52
|
-
)
|
53
|
-
for repo in $REPOS
|
54
|
-
do
|
55
|
-
sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "$CLIENT_PAYLOAD"
|
56
|
-
done
|
@@ -1,40 +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
|
-
- name: Update gems
|
33
|
-
shell: pwsh
|
34
|
-
run: |
|
35
|
-
gem install bundler
|
36
|
-
bundle config --local path vendor/bundle
|
37
|
-
bundle install --jobs 4 --retry 3
|
38
|
-
- name: Run specs
|
39
|
-
run: |
|
40
|
-
bundle exec rake
|