relaton-iso-bib 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 637ffa327aa126a02134f1bb84d39f2dc431b42e
4
- data.tar.gz: dccdaced7cd3ad6ec9a6ca863c3f64bf2e6d64c7
3
+ metadata.gz: 34e97929932b22fae6ad70bf14aa030c1a84a463
4
+ data.tar.gz: 59b85feda25ffe386f31d8e8af3b7b9128acadd0
5
5
  SHA512:
6
- metadata.gz: fe9f3b30ceb708660084d33fde87934c3f42446d97a6aa15fc8fbd6baf3bf02ac4e3e5cd1c31d378d504fdfba3f16ece1d24b1b91d4366827721950100908d36
7
- data.tar.gz: 2cdb6f97d9377e6e08061b97cb931bb04851abd162f1411dc570ff02651e95333bdad4c0df63dbc7ff37cad608c76a57f61a45313ec1fe80727ec175838da800
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.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.4)
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: technical_committee.map(&:to_hash) }
71
- hash[:subcommittee] = subcommittee.map(&:to_hash) if subcommittee&.any?
72
- hash[:workgroup] = workgroup.map(&:to_hash) if workgroup&.any?
73
- hash[:secretariat] = secretariat if secretariat
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: name }
108
- hash[:type] = type if type
109
- hash[:number] = number if number
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.fetch(:ics, []).map do |ics|
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
@@ -25,7 +25,7 @@ module RelatonIsoBib
25
25
  # @return [Hash]
26
26
  def to_hash
27
27
  hash = {}
28
- hash[:code] = code if code
28
+ hash["code"] = code if code
29
29
  hash
30
30
  end
31
31
  end
@@ -248,10 +248,10 @@ module RelatonIsoBib
248
248
  # @return [Hash]
249
249
  def to_hash
250
250
  hash = super
251
- hash[:editorialgroup] = editorialgroup.to_hash if editorialgroup
252
- hash[:ics] = ics.map(&:to_hash) if ics&.any?
253
- hash[:structuredidentifier] = structuredidentifier.to_hash if structuredidentifier
254
- hash[:type] = doctype if doctype
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[: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
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
@@ -1,3 +1,3 @@
1
1
  module RelatonIsoBib
2
- VERSION = "0.3.3".freeze
2
+ VERSION = "0.3.4".freeze
3
3
  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.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-13 00:00:00.000000000 Z
11
+ date: 2019-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler