metanorma-utils 1.0.7 → 1.0.8

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: 1608e885c3ac31aee00ba254d5f5c84088781a8ce5e8bc34d0a0fa8bf86c879a
4
- data.tar.gz: 79454a1aae9b7f3511d8c6b593e62faead745ab9b05e2f36f7d06610c991eb33
3
+ metadata.gz: 366ab5765fb28315b8c4258b6d766b04733ffbc69c912fd718f2229a5d5a9303
4
+ data.tar.gz: abdcfed1228161a42c79d748b4a50b36ef29c08f9b028c1ee86ce14b053db482
5
5
  SHA512:
6
- metadata.gz: 3f96993c89b0d752fd71f2775d05b012580760165fe55cc50b4b86e621d2c093eed5aa151d87597ce8f745cedb0388cc9370729d0d25f1331aaed439c11b862f
7
- data.tar.gz: 0e681cd4f98ba4fdebf683cb410bab222668e872460034b4b03182ba953b14b0b39c3b5ef473c12e4d6ac0ac41f092d6e683210099bb0c0aab665fe240d70c97
6
+ metadata.gz: 620d77ee112d112ee72e2fc90257692ff39120f6fa0e2e8d219e0a2790435e750ec2b6742c7a75cfb2a195e1e41bc5afe33d8b5aa015f616eac559ad9e6c9944
7
+ data.tar.gz: 42591f0ed4cdc91895f154c7f3c50d5e572b9870c77604367207ab1567025a7fbb07c3d9ca90965f8e688188ed91d894ded759db07eabc5008c6c3da5642c118
@@ -30,7 +30,9 @@ jobs:
30
30
  os: 'macos-latest'
31
31
  experimental: true
32
32
  steps:
33
- - uses: actions/checkout@master
33
+ - uses: actions/checkout@v2
34
+ with:
35
+ submodules: true
34
36
 
35
37
  - uses: ruby/setup-ruby@v1
36
38
  with:
@@ -45,7 +47,7 @@ jobs:
45
47
  steps:
46
48
  - uses: peter-evans/repository-dispatch@v1
47
49
  with:
48
- token: ${{ secrets.GITHUB_TOKEN }}
50
+ token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
49
51
  repository: ${{ github.repository }}
50
52
  event-type: notify
51
- client-payload: '{"ref": "${{ github.ref }}"}'
53
+ client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
data/lib/utils/main.rb CHANGED
@@ -109,18 +109,18 @@ module Metanorma
109
109
 
110
110
  SVG_NS = "http://www.w3.org/2000/svg".freeze
111
111
 
112
- def svgmap_rewrite(xmldoc, localdir = "")
112
+ def svgmap_rewrite(xmldoc, localdirectory = "")
113
113
  n = Namespace.new(xmldoc)
114
114
  xmldoc.xpath(n.ns("//svgmap")).each do |s|
115
- next unless svgmap_rewrite0(s, n)
115
+ next unless svgmap_rewrite0(s, n, localdirectory)
116
116
  next if s.at(n.ns("./target/eref"))
117
117
  s.replace(s.at(n.ns("./figure")))
118
118
  end
119
119
  end
120
120
 
121
- def svgmap_rewrite0(s, n)
121
+ def svgmap_rewrite0(s, n, localdirectory)
122
122
  if i = s.at(n.ns(".//image")) and src = i["src"]
123
- path = /^data:/.match(src) ? save_dataimage(src) : File.file?(src) ? src : localdir + src
123
+ path = /^data:/.match(src) ? save_dataimage(src) : File.file?(src) ? src : localdirectory + src
124
124
  File.file?(path) or return false
125
125
  svgmap_rewrite1(s, Nokogiri::XML(File.read(path, encoding: "utf-8")), path, n)
126
126
  /^data:/.match(src) and i["src"] = datauri(path)
@@ -176,10 +176,10 @@ module Metanorma
176
176
  end
177
177
 
178
178
  # sources/plantuml/plantuml20200524-90467-1iqek5i.png already includes localdir
179
- def datauri(uri, localdir = ".")
179
+ def datauri(uri, localdirectory = ".")
180
180
  return uri if /^data:/.match(uri)
181
181
  path = %r{^([A-Z]:)?/}.match?(uri) ? uri :
182
- File.exist?(uri) ? uri : File.join(localdir, uri)
182
+ File.exist?(uri) ? uri : File.join(localdirectory, uri)
183
183
  unless File.exist?(path)
184
184
  warn "image at #{path} not found"
185
185
  return uri
data/lib/utils/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Utils
3
- VERSION = "1.0.7".freeze
3
+ VERSION = "1.0.8".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-09 00:00:00.000000000 Z
11
+ date: 2021-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sterile