mn2pdf 1.38.1 → 1.42

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: 3920d0ce988ca4a0c1748d9c203e26c396f2fccf7ee8f4a04c6ff9afb5572639
4
- data.tar.gz: c3cdba0ff6c45eef7b44bd5020b98cde84fa193740c4556b04a6d9a660e66ee6
3
+ metadata.gz: db62f71291a732bacb13e82a70ec9cb01f0d69a080789d5e902d84e4cf4af4ff
4
+ data.tar.gz: 8f37a061dce13a8dcd177d13d60ced92b748931e0ec07d50238b1664e804a810
5
5
  SHA512:
6
- metadata.gz: 83a37bfd6a57cde548675913cb29ec0b12c9b0496d14435736c95e2d43d41f878bff1b605f95b570ea48a13e693f78e67452c191f2c4b8cdba7df4e9507805a8
7
- data.tar.gz: 947dc02d3aed97e8d98ad9c24a41263f34ee12866a665785aac74bfa57ee2a200614fb7eac4a33b873fdac4536d4bc3a8b3acd4ae58a86fa87ee94013f8835b2
6
+ metadata.gz: bc4e9b4719bd80929a8afcbd4c807fbff780c7be89708e085a6f9ff94f637609b6a0c9b66075a89e3c337d80e77ba5fbaf9577cb7aef05940c56694b1a691747
7
+ data.tar.gz: 9ea36a7f942960412485261396183f0a6c0ac2a753e72a2d24cf4e2f759113fb08c63aaae2917fa6359c9c95c15f20eca8402e70b75ce894012369be42d336b2
@@ -10,23 +10,6 @@ on:
10
10
 
11
11
  jobs:
12
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: [ '3.0', '2.7', '2.6', '2.5' ]
20
- os: [ ubuntu-latest, windows-latest, macos-latest ]
21
- experimental: [ false ]
22
- steps:
23
- - uses: actions/checkout@v2
24
- with:
25
- submodules: true
26
-
27
- - uses: ruby/setup-ruby@v1
28
- with:
29
- ruby-version: ${{ matrix.ruby }}
30
- bundler-cache: true
31
-
32
- - run: bundle exec rake
13
+ uses: metanorma/metanorma-build-scripts/.github/workflows/generic-rake.yml@main
14
+ secrets:
15
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
@@ -9,41 +9,42 @@ jobs:
9
9
  runs-on: ubuntu-18.04
10
10
  if: startsWith(github.event.client_payload.ref, 'refs/tags/v')
11
11
  steps:
12
- - uses: actions/checkout@v1
13
- - name: Add writable remote
14
- run: |
15
- git config --global user.name "metanorma-ci"
16
- git config --global user.email "metanorma-ci@users.noreply.github.com"
17
- git remote add github "https://metanorma-ci:${{ secrets.METANORMA_CI_PAT_TOKEN }}@github.com/$GITHUB_REPOSITORY.git"
18
- git pull github ${GITHUB_REF} --ff-only
12
+ - uses: actions/checkout@v2
13
+ with:
14
+ token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
15
+
19
16
  - name: Parse mn2pdf version
20
17
  env:
21
18
  MN2PDF_TAG: ${{ github.event.client_payload.ref }}
22
- run: |
23
- echo MN2PDF_VERSION=${MN2PDF_TAG#*/v} >> ${GITHUB_ENV}
24
- - name: Use Ruby
25
- uses: actions/setup-ruby@v1
19
+ run: echo MN2PDF_VERSION=${MN2PDF_TAG#*/v} >> ${GITHUB_ENV}
20
+
21
+ - uses: ruby/setup-ruby@v1
26
22
  with:
27
23
  ruby-version: '2.6'
28
- architecture: 'x64'
29
- - name: Update gems
30
- run: |
31
- gem install gem-release
32
- gem install bundler
33
- bundle install --jobs 4 --retry 3
34
- - name: Update version
35
- run: |
36
- gem bump --version ${MN2PDF_VERSION} --no-commit
37
- - name: Update mn2pdf.jar
38
- run: |
39
- rm -f bin/mn2pdf.jar
40
- rake bin/mn2pdf.jar
41
- - name: Run specs
42
- run: |
43
- bundle exec rake
24
+ bundler-cache: true
25
+
26
+ - run: gem install gem-release
27
+
28
+ - run: gem bump --version ${MN2PDF_VERSION} --no-commit
29
+
30
+ - run: bundle exec rake bin/mn2pdf.jar
31
+
32
+ - run: bundle exec rake
33
+
44
34
  - name: Push commit and tag
45
35
  run: |
46
- git add -u bin/mn2pdf.jar lib/mn2pdf/version.rb
36
+ git config --global user.name "metanorma-ci"
37
+ git config --global user.email "metanorma-ci@users.noreply.github.com"
38
+ git add -u lib/mn2pdf/version.rb
47
39
  git commit -m "Bump version to ${MN2PDF_VERSION}"
48
40
  git tag v${MN2PDF_VERSION}
49
- git push github HEAD:${GITHUB_REF} --tags
41
+ git push origin HEAD:${GITHUB_REF} --tags
42
+
43
+ - if: failure()
44
+ uses: JasonEtco/create-an-issue@v2
45
+ env:
46
+ GITHUB_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
47
+ with:
48
+ assignees: CAMOBAP
49
+ update_existing: true
50
+ search_existing: all
@@ -23,7 +23,7 @@ jobs:
23
23
  ruby-version: '2.6'
24
24
  bundler-cache: true
25
25
 
26
- - run: rm -f bin/mn2pdf.jar && rake bin/mn2pdf.jar
26
+ - run: bundle exec rake bin/mn2pdf.jar
27
27
 
28
28
  - run: bundle exec rake
29
29
 
@@ -48,3 +48,12 @@ jobs:
48
48
  chmod 0600 ~/.gem/credentials
49
49
  gem release
50
50
 
51
+ - if: failure()
52
+ uses: JasonEtco/create-an-issue@v2
53
+ env:
54
+ GITHUB_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
55
+ with:
56
+ assignees: CAMOBAP
57
+ update_existing: true
58
+ search_existing: all
59
+
data/.gitignore CHANGED
@@ -10,3 +10,7 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+
14
+ .rubocop-http*
15
+
16
+ /bin/mn2pdf.jar
data/Rakefile CHANGED
@@ -1,17 +1,26 @@
1
- require 'bundler/gem_tasks'
2
- require 'rspec/core/rake_task'
3
- require_relative 'lib/mn2pdf/version'
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+ require "open-uri"
4
+ require_relative "lib/mn2pdf/version"
4
5
 
5
6
  RSpec::Core::RakeTask.new(:spec)
6
7
 
7
- task :default => :spec
8
+ task default: ["bin/mn2pdf.jar", :spec]
8
9
 
9
- require 'open-uri'
10
+ def jar_url(ver)
11
+ "https://github.com/metanorma/mn2pdf/releases/download/v#{ver}/mn2pdf-#{ver}.jar"
12
+ end
10
13
 
11
- file 'bin/mn2pdf.jar' do |file|
12
- ver = Mn2pdf::VERSION
13
- url = "https://github.com/metanorma/mn2pdf/releases/download/v#{ver}/mn2pdf-#{ver}.jar"
14
- File.open(file.name, 'wb') do |file|
15
- file.write open(url).read
14
+ file "bin/mn2pdf.jar" do |file|
15
+ if Mn2pdf::VERSION != Mn2pdf::MN2PDF_JAR_VERSION
16
+ begin
17
+ URI.parse(jar_url(Mn2pdf::VERSION)).open
18
+ abort(%(MN2PDF_JAR_VERSION in lib/mn2pdf/version.rb is outdated!
19
+ Assign VERSION to MN2PDF_JAR_VERSION))
20
+ rescue OpenURI::HTTPError, Errno::ENOENT
21
+ # expected
22
+ end
16
23
  end
17
- end
24
+ url = jar_url(Mn2pdf::MN2PDF_JAR_VERSION)
25
+ File.binwrite(file.name, URI.parse(url).read)
26
+ end
data/bin/mn2pdf.jar CHANGED
Binary file
@@ -1,3 +1,4 @@
1
1
  module Mn2pdf
2
- VERSION = "1.38.1".freeze
2
+ VERSION = "1.42".freeze
3
+ MN2PDF_JAR_VERSION = VERSION
3
4
  end
data/lib/mn2pdf.rb CHANGED
@@ -3,8 +3,6 @@ require "rbconfig"
3
3
  require "tempfile"
4
4
  require "yaml"
5
5
 
6
- require "mn2pdf/version"
7
-
8
6
  module Mn2pdf
9
7
  MN2PDF_JAR_PATH = File.join(File.dirname(__FILE__), "../bin/mn2pdf.jar")
10
8
  DEFAULT_JAVA_OPTS = ["-Xss5m", "-Xmx2048m"].freeze
@@ -47,7 +45,8 @@ module Mn2pdf
47
45
  manifest = options.delete(FONTS_MANIFEST)
48
46
 
49
47
  options.each do |k, v|
50
- cmd << "#{k} #{quote(v)}"
48
+ sep = k.to_s.end_with?("=") ? "" : " "
49
+ cmd << "#{k}#{sep}#{quote(v)}"
51
50
  end
52
51
  if manifest
53
52
  dump_fontist_manifest_locations(manifest) do |manifest_path|
@@ -87,6 +86,7 @@ module Mn2pdf
87
86
  end
88
87
 
89
88
  def self.quote(str)
89
+ return "" if str.nil? || str.empty?
90
90
  return str if /^'.*'$/.match(str) || /^".*"$/.match(str)
91
91
 
92
92
  %("#{str}")
data/mn2pdf.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.bindir = "bin"
20
20
  spec.require_paths = ["lib"]
21
21
  spec.files = `git ls-files`.split("\n")
22
- spec.test_files = `git ls-files -- {spec}/*`.split("\n")
22
+ spec.test_files = `git ls-files -- {spec}/*`.split("\n") << "bin/mn2pdf.jar"
23
23
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
24
24
 
25
25
  # Specify which files should be added to the gem when it is released.
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.38.1
4
+ version: '1.42'
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: 2021-10-25 00:00:00.000000000 Z
11
+ date: 2022-04-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  mn2pdf converts Metanorma XML into PDF.
@@ -41,7 +41,7 @@ homepage: https://github.com/metanorma/mn2pdf-ruby
41
41
  licenses:
42
42
  - BSD-2-Clause
43
43
  metadata: {}
44
- post_install_message:
44
+ post_install_message:
45
45
  rdoc_options: []
46
46
  require_paths:
47
47
  - lib
@@ -56,8 +56,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  requirements: []
59
- rubygems_version: 3.2.22
60
- signing_key:
59
+ rubygems_version: 3.0.3.1
60
+ signing_key:
61
61
  specification_version: 4
62
62
  summary: mn2pdf converts Metanorma XML into PDF.
63
- test_files: []
63
+ test_files:
64
+ - bin/mn2pdf.jar