relaton-bib 1.9.17 → 1.9.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_bib/bibliographic_item.rb +9 -2
- data/lib/relaton_bib/document_identifier.rb +1 -1
- data/lib/relaton_bib/document_relation.rb +1 -1
- data/lib/relaton_bib/document_status.rb +1 -1
- data/lib/relaton_bib/localized_string.rb +6 -2
- data/lib/relaton_bib/structured_identifier.rb +12 -11
- data/lib/relaton_bib/typed_uri.rb +1 -1
- data/lib/relaton_bib/version.rb +1 -1
- data/lib/relaton_bib/xml_parser.rb +3 -2
- data/relaton-bib.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 974c021271bddc8c3ab783eae039697f62010c33f035e24b2bb96051a6138b8a
|
4
|
+
data.tar.gz: 71157a9ac56ec96549886354db9b6a301ead662e43ec8abefea1bdc27ec8539c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fec9fcd2fad29d5128b739fb478b0198bdeeb1a6ab2b9806d8dc73c51290ddcea19fe3481fdc5f104369c34f26fd6e7661a02d5927cf3eed7416b58516cbd915
|
7
|
+
data.tar.gz: 85890cd5bde2fee2e9fefe9188f4a892019b92414b235bbde5e91453b878b6bbe31d5d8d364939ec6662859c0ec0f9362836d938447ac0b2921fd2ce7863a40c
|
@@ -935,8 +935,15 @@ module RelatonBib
|
|
935
935
|
def render_organization(builder, org)
|
936
936
|
return unless org
|
937
937
|
|
938
|
-
|
939
|
-
|
938
|
+
ab = org.abbreviation&.content
|
939
|
+
on = org.name.first&.content
|
940
|
+
orgname = if ab == "IEEE" || on == "Istitute of Electrical and Electronics Engineers"
|
941
|
+
"IEEE"
|
942
|
+
elsif ab == "W3C" || on == "World Wide Web Consortium" then "W3C"
|
943
|
+
else on || ab
|
944
|
+
end
|
945
|
+
o = builder.organization orgname
|
946
|
+
o[:abbrev] = ab if ab
|
940
947
|
end
|
941
948
|
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
942
949
|
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
@@ -36,7 +36,7 @@ module RelatonBib
|
|
36
36
|
attr_reader :source_locality
|
37
37
|
|
38
38
|
# @param type [String]
|
39
|
-
# @
|
39
|
+
# @param description [RelatonBib::FormattedString, NilClass]
|
40
40
|
# @param bibitem [RelatonBib::BibliographicItem,
|
41
41
|
# RelatonIso::IsoBibliographicItem]
|
42
42
|
# @param locality [Array<RelatonBib::Locality, RelatonBib::LocalityStack>]
|
@@ -56,10 +56,14 @@ module RelatonBib
|
|
56
56
|
else
|
57
57
|
builder.parent["language"] = language.join(",") if language&.any?
|
58
58
|
builder.parent["script"] = script.join(",") if script&.any?
|
59
|
-
builder.parent <<
|
59
|
+
builder.parent << escaped_content # .encode(xml: :text)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
+
def escaped_content
|
64
|
+
content.encode("UTF-8") # .gsub(/&/, "&").gsub(/"/, """).gsub(/'/, "'")
|
65
|
+
end
|
66
|
+
|
63
67
|
# @return [Hash]
|
64
68
|
def to_hash # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
65
69
|
if content.is_a? String
|
@@ -77,7 +81,7 @@ module RelatonBib
|
|
77
81
|
# @param count [Integer] number of elements
|
78
82
|
# @return [String]
|
79
83
|
def to_asciibib(prefix = "", count = 1, has_attrs = false) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/MethodLength
|
80
|
-
pref = prefix.empty? ? prefix : prefix
|
84
|
+
pref = prefix.empty? ? prefix : "#{prefix}."
|
81
85
|
if content.is_a? String
|
82
86
|
unless language&.any? || script&.any? || has_attrs
|
83
87
|
return "#{prefix}:: #{content}\n"
|
@@ -70,17 +70,18 @@ module RelatonBib
|
|
70
70
|
|
71
71
|
# rubocop:disable Metrics/MethodLength
|
72
72
|
|
73
|
-
# @param
|
74
|
-
# @param
|
75
|
-
# @
|
76
|
-
# @
|
77
|
-
# @
|
78
|
-
# @
|
79
|
-
# @
|
80
|
-
# @
|
81
|
-
# @
|
82
|
-
# @
|
83
|
-
# @
|
73
|
+
# @param docnumber [String]
|
74
|
+
# @param args [Hash]
|
75
|
+
# @option args [String, nil] :type
|
76
|
+
# @option args [Array<String>] :agency
|
77
|
+
# @option args [Stirng, nil] :class
|
78
|
+
# @option args [String, nil] :partnumber
|
79
|
+
# @option args [String, nil] :edition
|
80
|
+
# @option args [String, nil] :version
|
81
|
+
# @option args [String, nil] :supplementtype
|
82
|
+
# @option args [String, nil] :supplementnumber
|
83
|
+
# @option args [String, nil] :language
|
84
|
+
# @option args [String, nil] :year
|
84
85
|
def initialize(docnumber:, **args)
|
85
86
|
@type = args[:type]
|
86
87
|
@agency = args[:agency]
|
data/lib/relaton_bib/version.rb
CHANGED
@@ -11,7 +11,7 @@ module RelatonBib
|
|
11
11
|
bib_item item_data(bibitem)
|
12
12
|
else
|
13
13
|
warn "[relaton-bib] WARNING: can't find bibitem or bibdata element "\
|
14
|
-
|
14
|
+
"in the XML"
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -320,7 +320,8 @@ module RelatonBib
|
|
320
320
|
# @return [Array<RelatonBib::FormattedString>]
|
321
321
|
def fetch_abstract(item)
|
322
322
|
item.xpath("./abstract").map do |a|
|
323
|
-
|
323
|
+
c = a.children.to_s
|
324
|
+
FormattedString.new(content: c, language: a[:language],
|
324
325
|
script: a[:script], format: a[:format])
|
325
326
|
end
|
326
327
|
end
|
data/relaton-bib.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-bib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.
|
4
|
+
version: 1.9.18
|
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-01-
|
11
|
+
date: 2022-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -182,16 +182,16 @@ dependencies:
|
|
182
182
|
name: nokogiri
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- - "
|
185
|
+
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
187
|
+
version: 1.12.5
|
188
188
|
type: :runtime
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- - "
|
192
|
+
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
194
|
+
version: 1.12.5
|
195
195
|
description: 'RelatonBib: Ruby XMLDOC impementation.'
|
196
196
|
email:
|
197
197
|
- open.source@ribose.com
|