isodoc 2.9.1 → 2.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/function/references.rb +2 -19
- data/lib/isodoc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6490ec54ec083e91ab1ccc941676b95d52d3cef3f9b7675e2900e47c1763e47a
|
4
|
+
data.tar.gz: f5190668941e4f42990f024a3852007f3d2a6accfef80e6d242208c814ffe0d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb67b78f6de41bcf847ff4bf5846261b54dc9eed3e6ac755d2b13186ee70c4dc78a1c23f4804a47c147ffcc3076fd9845986043a242c3ad60194bd4c4c1435ca
|
7
|
+
data.tar.gz: 694543df44379a3fdde8eebbfefcf13a1d805ae0efbc02743219b7797ca2c5f81171667c3930549e4962fa149f5a8ac518475787489730fb1de3f39f27724abe
|
@@ -29,33 +29,16 @@ module IsoDoc
|
|
29
29
|
SKIP_DOCID = <<~XPATH.strip.freeze
|
30
30
|
@type = 'DOI' or @type = 'doi' or @type = 'ISSN' or @type = 'issn' or @type = 'ISBN' or @type = 'isbn' or starts-with(@type, 'ISSN.') or starts-with(@type, 'ISBN.') or starts-with(@type, 'issn.') or starts-with(@type, 'isbn.')
|
31
31
|
XPATH
|
32
|
-
=begin
|
33
|
-
SKIP_DOC1 = <<~XPATH.strip.freeze
|
34
|
-
#{SKIP_DOCID} or @type = 'metanorma-ordinal' or @type = 'metanorma'
|
35
|
-
XPATH
|
36
32
|
|
37
|
-
PRIMARY_ID = "docidentifier[@primary = 'true']".freeze
|
38
|
-
=end
|
39
33
|
def pref_ref_code(bib)
|
40
34
|
bib["suppress_identifier"] == "true" and return nil
|
41
35
|
@bibrenderer ||= bibrenderer
|
42
36
|
data, = @bibrenderer.parse(bib)
|
43
|
-
ret = data[:authoritative_identifier]
|
37
|
+
ret = data[:authoritative_identifier] or return nil
|
44
38
|
ret.empty? and return nil
|
45
39
|
ret
|
46
40
|
end
|
47
|
-
|
48
|
-
def pref_ref_code1(bib)
|
49
|
-
lang = "[@language = '#{@lang}']"
|
50
|
-
ret = bib.xpath(ns("./#{PRIMARY_ID}[not(#{SKIP_DOCID})]#{lang}"))
|
51
|
-
ret.empty? and
|
52
|
-
ret = bib.xpath(ns("./#{PRIMARY_ID}[not(#{SKIP_DOCID})]"))
|
53
|
-
ret.empty? and
|
54
|
-
ret = bib.at(ns("./docidentifier[not(#{SKIP_DOC1})]#{lang}")) ||
|
55
|
-
bib.at(ns("./docidentifier[not(#{SKIP_DOC1})]"))
|
56
|
-
ret
|
57
|
-
end
|
58
|
-
=end
|
41
|
+
|
59
42
|
# returns [metanorma, non-metanorma, DOI/ISSN/ISBN] identifiers
|
60
43
|
def bibitem_ref_code(bib)
|
61
44
|
id = bib.at(ns("./docidentifier[@type = 'metanorma']"))
|
data/lib/isodoc/version.rb
CHANGED