relaton-iso-bib 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/relaton_iso_bib/editorial_group.rb +9 -7
- data/lib/relaton_iso_bib/hash_converter.rb +4 -4
- data/lib/relaton_iso_bib/ics.rb +1 -1
- data/lib/relaton_iso_bib/iso_bibliographic_item.rb +4 -4
- data/lib/relaton_iso_bib/structured_identifier.rb +5 -5
- data/lib/relaton_iso_bib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34e97929932b22fae6ad70bf14aa030c1a84a463
|
4
|
+
data.tar.gz: 59b85feda25ffe386f31d8e8af3b7b9128acadd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05fd243871b9bb2325837135d3207dd5cd14c4fb65ce160f74cf9c4e0d463eec15f3161ad739cae5474156dad3ee6a824dbea50227509fa06f590ce738be4c28
|
7
|
+
data.tar.gz: 67c4ba59d22a20612a68318e58a0c07ff7d0f03da0a1433d0f920b00848cebc9c1b11390c081ad3ed2ca1c2898639ead7b1f7e908c16ce157accd7097b4f0fe5
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
relaton-iso-bib (0.3.
|
4
|
+
relaton-iso-bib (0.3.4)
|
5
5
|
isoics (~> 0.1.6)
|
6
6
|
relaton-bib (~> 0.3.0)
|
7
7
|
ruby_deep_clone (~> 0.8.0)
|
@@ -34,7 +34,7 @@ GEM
|
|
34
34
|
pry (~> 0.10)
|
35
35
|
public_suffix (3.1.1)
|
36
36
|
rake (10.5.0)
|
37
|
-
relaton-bib (0.3.
|
37
|
+
relaton-bib (0.3.5)
|
38
38
|
addressable
|
39
39
|
nokogiri (~> 1.10)
|
40
40
|
rspec (3.8.0)
|
@@ -3,6 +3,8 @@
|
|
3
3
|
module RelatonIsoBib
|
4
4
|
# ISO project group.
|
5
5
|
class EditorialGroup
|
6
|
+
include RelatonBib
|
7
|
+
|
6
8
|
# @return [Array<RelatonIsoBib::IsoSubgroup>]
|
7
9
|
attr_reader :technical_committee
|
8
10
|
|
@@ -67,10 +69,10 @@ module RelatonIsoBib
|
|
67
69
|
|
68
70
|
# @return [Hash]
|
69
71
|
def to_hash
|
70
|
-
hash = { technical_committee
|
71
|
-
hash[
|
72
|
-
hash[
|
73
|
-
hash[
|
72
|
+
hash = { "technical_committee" => single_element_array(technical_committee) }
|
73
|
+
hash["subcommittee"] = single_element_array(subcommittee) if subcommittee&.any?
|
74
|
+
hash["workgroup"] = single_element_array(workgroup) if workgroup&.any?
|
75
|
+
hash["secretariat"] = secretariat if secretariat
|
74
76
|
hash
|
75
77
|
end
|
76
78
|
end
|
@@ -104,9 +106,9 @@ module RelatonIsoBib
|
|
104
106
|
|
105
107
|
# @return [Hash]
|
106
108
|
def to_hash
|
107
|
-
hash = { name
|
108
|
-
hash[
|
109
|
-
hash[
|
109
|
+
hash = { "name" => name }
|
110
|
+
hash["type"] = type if type
|
111
|
+
hash["number"] = number if number
|
110
112
|
hash
|
111
113
|
end
|
112
114
|
end
|
@@ -94,16 +94,16 @@ module RelatonIsoBib
|
|
94
94
|
return unless eg
|
95
95
|
|
96
96
|
ret[:editorialgroup] = EditorialGroup.new(
|
97
|
-
technical_committee: eg[:technical_committee],
|
98
|
-
subcommittee: eg[:subcommittee],
|
99
|
-
workgroup: eg[:workgroup],
|
97
|
+
technical_committee: array(eg[:technical_committee]),
|
98
|
+
subcommittee: array(eg[:subcommittee]),
|
99
|
+
workgroup: array(eg[:workgroup]),
|
100
100
|
secretariat: eg[:secretariat],
|
101
101
|
)
|
102
102
|
end
|
103
103
|
|
104
104
|
# @param ret [Hash]
|
105
105
|
def ics_hash_to_bib(ret)
|
106
|
-
ret[:ics] = ret
|
106
|
+
ret[:ics] = array(ret[:ics]).map do |ics|
|
107
107
|
ics[:code] ? Ics.new(ics[:code]) : Ics.new(ics)
|
108
108
|
end
|
109
109
|
end
|
data/lib/relaton_iso_bib/ics.rb
CHANGED
@@ -248,10 +248,10 @@ module RelatonIsoBib
|
|
248
248
|
# @return [Hash]
|
249
249
|
def to_hash
|
250
250
|
hash = super
|
251
|
-
hash[
|
252
|
-
hash[
|
253
|
-
hash[
|
254
|
-
hash[
|
251
|
+
hash["editorialgroup"] = editorialgroup.to_hash if editorialgroup
|
252
|
+
hash["ics"] = single_element_array(ics) if ics&.any?
|
253
|
+
hash["structuredidentifier"] = structuredidentifier.to_hash if structuredidentifier
|
254
|
+
hash["type"] = doctype if doctype
|
255
255
|
hash
|
256
256
|
end
|
257
257
|
|
@@ -71,11 +71,11 @@ module RelatonIsoBib
|
|
71
71
|
# @return [Hash]
|
72
72
|
def to_hash
|
73
73
|
hash = {}
|
74
|
-
hash[
|
75
|
-
hash[
|
76
|
-
hash[
|
77
|
-
hash[
|
78
|
-
hash[
|
74
|
+
hash["tc_document_number"] = tc_document_number if tc_document_number
|
75
|
+
hash["project_number"] = project_number if project_number
|
76
|
+
hash["part"] = part if part
|
77
|
+
hash["subpart"] = subpart if subpart
|
78
|
+
hash["type"] = type if type
|
79
79
|
hash
|
80
80
|
end
|
81
81
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-iso-bib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|