relaton-bib 1.12.2 → 1.12.5
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/bibxml_parser.rb +4 -1
- data/lib/relaton_bib/document_relation.rb +1 -1
- data/lib/relaton_bib/document_relation_collection.rb +16 -1
- data/lib/relaton_bib/document_status.rb +2 -2
- data/lib/relaton_bib/technical_committee.rb +2 -4
- data/lib/relaton_bib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c9fcdf11eebba058d61ceabd8c2479615f59e15574137b528cfd7853296c353
|
4
|
+
data.tar.gz: 429f58fb92119a68f41b828f035e52a7d0acf4d929f87b18c6853db906f166f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9a7ad332dc420595b4ba0f3c06edb2fa598a6c47c934c3c6a837e607541e2fe1d4e0c6e01294aac6b3f9e3cc5e1d3c0eb285f32b5b7a8782aa06c20d31f395c
|
7
|
+
data.tar.gz: 373bcb27506217f6b170dab13cee9dac7c17dd37efe630dc7fccde29a1cb37c68937ee9c6a7ad101aca75d06bf43b2215d8743551ad70025d47dc685cf4ac092
|
@@ -251,7 +251,10 @@ module RelatonBib
|
|
251
251
|
# "front/author[not(@surname)][not(@fullname)]/organization",
|
252
252
|
# ).map do |org|
|
253
253
|
org = contrib.at("./organization")
|
254
|
-
|
254
|
+
orgname = org.text.strip
|
255
|
+
return if orgname.empty?
|
256
|
+
|
257
|
+
name = ORGNAMES[orgname] || orgname
|
255
258
|
{ entity: new_org(name, org[:abbrev]), role: [contributor_role(contrib)] }
|
256
259
|
# end
|
257
260
|
end
|
@@ -6,7 +6,7 @@ module RelatonBib
|
|
6
6
|
extend Forwardable
|
7
7
|
|
8
8
|
def_delegators :@array, :<<, :[], :first, :last, :empty?, :any?, :size,
|
9
|
-
:each, :detect, :map, :reduce, :length, :unshift
|
9
|
+
:each, :detect, :map, :reduce, :length, :unshift, :max_by
|
10
10
|
|
11
11
|
# @param relation [Array<RelatonBib::DocumentRelation, Hash>]
|
12
12
|
# @option relation [String] :type
|
@@ -21,6 +21,21 @@ module RelatonBib
|
|
21
21
|
@array = relation.map { |r| r.is_a?(Hash) ? DocumentRelation.new(**r) : r }
|
22
22
|
end
|
23
23
|
|
24
|
+
#
|
25
|
+
# Returns new DocumentRelationCollection with selected relations.
|
26
|
+
#
|
27
|
+
# @example Select relations with type "obsoletes"
|
28
|
+
# relations.select { |r| r.type == "obsoletes" }
|
29
|
+
# #=> <RelatonBib::DocRelationCollection:0x00007f9a0191d5f0 @array=[...]>
|
30
|
+
#
|
31
|
+
# @return [RelatonBib::DocRelationCollection] new DocumentRelationCollection
|
32
|
+
# with selected relations
|
33
|
+
#
|
34
|
+
def select(&block)
|
35
|
+
arr = @array.select(&block)
|
36
|
+
self.class.new arr
|
37
|
+
end
|
38
|
+
|
24
39
|
# @todo We don't have replace type anymore. Suppose we should update this
|
25
40
|
# method or delete it.
|
26
41
|
#
|
@@ -56,8 +56,8 @@ module RelatonBib
|
|
56
56
|
def stage_new(stg)
|
57
57
|
case stg
|
58
58
|
when Stage then stg
|
59
|
-
when Hash then Stage.new(**stg)
|
60
|
-
when String then Stage.new(value: stg)
|
59
|
+
when Hash then self.class::Stage.new(**stg)
|
60
|
+
when String then self.class::Stage.new(value: stg)
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -12,9 +12,7 @@ module RelatonBib
|
|
12
12
|
|
13
13
|
# @param builder [Nokogiri::XML::Builder]
|
14
14
|
def to_xml(builder)
|
15
|
-
builder.send
|
16
|
-
workgroup.to_xml b
|
17
|
-
end
|
15
|
+
builder.send(:"technical-committee") { |b| workgroup.to_xml b }
|
18
16
|
end
|
19
17
|
|
20
18
|
# @return [Hash]
|
@@ -26,7 +24,7 @@ module RelatonBib
|
|
26
24
|
# @param count [Integer] number of technical committees
|
27
25
|
# @return [String]
|
28
26
|
def to_asciibib(prefix = "", count = 1)
|
29
|
-
pref = prefix.empty? ? prefix : prefix
|
27
|
+
pref = prefix.empty? ? prefix : "#{prefix}."
|
30
28
|
pref += "technical_committee"
|
31
29
|
out = count > 1 ? "#{pref}::\n" : ""
|
32
30
|
out += workgroup.to_asciibib pref
|
data/lib/relaton_bib/version.rb
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.12.
|
4
|
+
version: 1.12.5
|
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-
|
11
|
+
date: 2022-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|