metanorma-iho 0.4.5 → 0.5.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: fe0847c09cfdfde2e17055709884e36114585df1c82e72ca972959da5537b915
4
- data.tar.gz: 61017f76453d1a730328e274a5f6b150c0761c69340cbd92244b2ce1fc01efba
3
+ metadata.gz: 4082060ac60fbd1e8eba4fcf79e0591b0e41b8efe8977c1ace2a00ed3c37d1e5
4
+ data.tar.gz: 58176a042041336c07803e46439ebc0ef095c84353db29847669aea5ceeeedb6
5
5
  SHA512:
6
- metadata.gz: e4be9b3b344e0ea3c98bf779a1880770a97a5099c56857ecce0d2f55b05ad34d67288b092b71d10a25d520da7b6777bb41d648bb1fba6e2451ca34d15a66d34d
7
- data.tar.gz: d67e94e5dc7b1460503b60da913339dd59e46b709917e97af3daa064b67ef21c586333f8860b36fcb15e2301a960bf44f86340c87c0effbe0c0a8685085fa37d
6
+ metadata.gz: '048b316ef1689e16aa924af0b3b868c725dc64c3d36142c74adecd5c01a4a8c696250d9fbe4f3dfdfc835bd3f8b8185a9d9c20aa5bb2bed4b23c51791dca4b19'
7
+ data.tar.gz: c55b5acea52a9d45aa69eb970ea689e8375b5241a4c05486d020e44628a4ae70b8e8ae9c09e96ab801078cb5925e6aabef7427ce442f603751fee092f456b27b
@@ -10,34 +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@master
24
-
25
- - uses: ruby/setup-ruby@v1
26
- with:
27
- ruby-version: ${{ matrix.ruby }}
28
- bundler-cache: true
29
-
30
- - uses: metanorma/metanorma-build-scripts/plantuml-setup-action@master
31
-
32
- - run: bundle exec rake
33
-
34
- tests-passed:
35
- needs: rake
36
- runs-on: ubuntu-latest
37
- steps:
38
- - uses: peter-evans/repository-dispatch@v1
39
- with:
40
- token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
41
- repository: ${{ github.repository }}
42
- event-type: tests-passed
43
- client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
13
+ uses: metanorma/metanorma-build-scripts/.github/workflows/generic-rake.yml@main
14
+ secrets:
15
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
data/.gitignore CHANGED
@@ -1 +1,12 @@
1
1
  .rubocop-https--*
2
+
3
+ /.rspec_status
4
+ /Gemfile.devel
5
+ /Gemfile.lock
6
+ /coverage/
7
+ /test.doc
8
+ /test.err
9
+ /test.html
10
+ /test.pdf
11
+ /test.presentation.xml
12
+ /test_*_htmlimages/
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "asciidoctor/rsd"
4
+ require "metanorma/iho"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -27,7 +27,7 @@ module IsoDoc
27
27
  xml.span do |s|
28
28
  node&.children&.each { |x| parse(x, s) }
29
29
  end
30
- end.join("")
30
+ end.join
31
31
  end
32
32
 
33
33
  def multiplenames_and(names)
@@ -56,13 +56,15 @@ module IsoDoc
56
56
  def inline_bibitem_ref_code(bib)
57
57
  id = bib.at(ns("./docidentifier[not(@type = 'DOI' or "\
58
58
  "@type = 'metanorma' or @type = 'ISSN' or "\
59
- "@type = 'ISBN' or @type = 'rfc-anchor')]"))
60
- id ||= bib.at(ns("./docidentifier[not(@type = 'metanorma')]"))
61
- return [nil, id, nil] if id
59
+ "@type = 'ISBN' or @type = 'rfc-anchor' or "\
60
+ "@type = 'metanorma-ordinal')]"))
61
+ id ||= bib.at(ns("./docidentifier[not(@type = 'metanorma' or "\
62
+ "@type = 'metanorma-ordinal')]"))
63
+ return [nil, id, nil, nil] if id
62
64
 
63
65
  id = Nokogiri::XML::Node.new("docidentifier", bib.document)
64
66
  id << "(NO ID)"
65
- [nil, id, nil]
67
+ [nil, id, nil, nil]
66
68
  end
67
69
 
68
70
  def extract_edition(bib)
@@ -101,9 +103,9 @@ module IsoDoc
101
103
  c = p.at(ns("./completename")) and return c.text
102
104
  s = p&.at(ns("./surname"))&.text or return
103
105
  i = p.xpath(ns("./initial")) and
104
- front = i.map { |e| e.text.gsub(/[^[:upper:]]/, "") }.join("")
106
+ front = i.map { |e| e.text.gsub(/[^[:upper:]]/, "") }.join
105
107
  i.empty? and f = p.xpath(ns("./forename")) and
106
- front = f.map { |e| e.text[0].upcase }.join("")
108
+ front = f.map { |e| e.text[0].upcase }.join
107
109
  front ? "#{s} #{front}" : s
108
110
  end
109
111
 
@@ -117,10 +119,10 @@ module IsoDoc
117
119
  ftitle&.children&.each { |n| parse(n, out) }
118
120
  else
119
121
  id = render_identifier(inline_bibitem_ref_code(bib))
120
- out << id[1] if id[1]
122
+ out << id[:sdo] if id[:sdo]
121
123
  ed = extract_edition(bib) if iho?(bib)
122
124
  out << " edition #{ed}" if ed
123
- out << ": " if id[1] || ed
125
+ out << ": " if id[:sdo] || ed
124
126
  iso_title(bib)&.children&.each { |n| parse(n, out) }
125
127
  out << ", "
126
128
  author = extract_author(bib)