mn2pdf 1.41 → 1.44

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: 4a0c240f5a70e4ac365e0a73680af079529857cf58260bfa430dd84367b73e0c
4
- data.tar.gz: a327cd5eca2ee959345b8c32701868d24082fb9e2718f52ec7191c9b43e17547
3
+ metadata.gz: 936eaf64d0aea6ed9ae25c32edd6169a90e80081aac15191f20fb0586480ff05
4
+ data.tar.gz: 3bdbb20e9a30232c9c3803121f441d157eff01aa8bc05c4e3adf6cc313f83070
5
5
  SHA512:
6
- metadata.gz: a11c040d8123f84e6686d42021fbcc51d72d3a17d16a1af762f0d5d895b0d1f557f9bb39d1cf40d6fb883fcffa3197fcf0ff8af54779e5786fc683eca603b287
7
- data.tar.gz: aed4221c3d24355f347d5a89fdba8c45a8ff8a8eb06e6ccad84c4c8180387f17e5e952cf6614505de6840f73946b260e313a3c62b5826e2e825ee7151325777b
6
+ metadata.gz: ceb38c1f4cd4547ba85c71085c1a6b8f2e73e32de96d8d9bbfee0eb2023ae12305568eac81a57f6d575769357c9e3a1ae96699fb86f5320f0e6b9792de25e55a
7
+ data.tar.gz: 664323a700fcc3baa3bdbaf9d64c3ee269b510a2312adb78319951711f6f967bef9442406294c48853b20edfdbf243dc455751e6bcf2859d876f666c3ef90ffc
@@ -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.41".freeze
2
+ VERSION = "1.44".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.41'
4
+ version: '1.44'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-10 00:00:00.000000000 Z
11
+ date: 2022-05-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  mn2pdf converts Metanorma XML into PDF.
@@ -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.0.3
59
+ rubygems_version: 3.0.3.1
60
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