gbbib 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd82764d26babcef9ad8c9e5882357bee50aa130f7ea98031a7e9950aed944b0
4
- data.tar.gz: 63ba319a8bd84f5550301477c74412ab56cd75d94bf1dd0c25621d3c8430cfe1
3
+ metadata.gz: 78ab0edb324c7147e21cdffdb800cac302407fbcbe024ebc58c7b33b62656cd7
4
+ data.tar.gz: 3c94800617a4b09995b458bc07def7f54f097abc75ff8539f3a609d70adf2ddc
5
5
  SHA512:
6
- metadata.gz: bb519815fe2e2c8a2bee7eaf9f83c34913b7ff84ddfdee5a87c98eb18e461d9d9a7601e6f09568e1ea517fb5b853688fb39b17d9895513515d0eb7a1d7f7fc04
7
- data.tar.gz: 66bb74992020a9056b25cdedca2029f40322c5d29e6ee3fc7146f980bda2f71c720f60c0f5d39ee10c7f9d3cdb5330254483df3c32bbc4cbbdfbf18d4910e61a
6
+ metadata.gz: 53a84eee4cb2b23876c5a3c4a96dfc4694893ee888da34570f2f93df3c34c9bb46095271fdb2198f5f221d76dce32a181a4ee4b3291207892fe6c6ebb9179e45
7
+ data.tar.gz: dfd414fc158282b1c744bcfc96f23464ae75659af1f2d065311b6fcb3e2d6faa3711d525717b26302bd0272d64586857d054fd9ab2598f59a32e62c944a5d250
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gbbib (0.4.0)
4
+ gbbib (0.4.1)
5
5
  cnccs (~> 0.1.1)
6
6
  gb-agencies (~> 0.0.1)
7
- iso-bib-item (~> 0.4.1)
7
+ iso-bib-item (~> 0.4.2)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
@@ -17,7 +17,7 @@ GEM
17
17
  equivalent-xml (0.6.0)
18
18
  nokogiri (>= 1.4.3)
19
19
  gb-agencies (0.0.3)
20
- iso-bib-item (0.4.1)
20
+ iso-bib-item (0.4.2)
21
21
  isoics (~> 0.1.6)
22
22
  nokogiri (~> 1.8.4)
23
23
  ruby_deep_clone (~> 0.8.0)
@@ -31,6 +31,6 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
32
32
 
33
33
  spec.add_dependency 'cnccs', "~> 0.1.1"
34
- spec.add_dependency 'iso-bib-item', "~> 0.4.1"
34
+ spec.add_dependency 'iso-bib-item', "~> 0.4.2"
35
35
  spec.add_dependency 'gb-agencies', "~> 0.0.1"
36
36
  end
@@ -29,7 +29,7 @@ module Gbbib
29
29
 
30
30
  def initialize(**args)
31
31
  super
32
- @committee = GbTechnicalCommittee.new args[:committee]
32
+ args[:committee] and @committee = GbTechnicalCommittee.new(args[:committee])
33
33
  @ccs = args[:ccs].map { |c| Cnccs.fetch c }
34
34
  @gbtype = GbStandardType.new args[:gbtype]
35
35
  @type = args[:type]
@@ -73,7 +73,7 @@ module Gbbib
73
73
 
74
74
  # @param builder [Nokogiri::XML::Builder]
75
75
  def render_gbxml(builder)
76
- committee.to_xml builder
76
+ committee.to_xml builder if committee
77
77
  gbtype.to_xml builder
78
78
  return unless ccs.any?
79
79
  ccs.each do |c|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gbbib
4
- VERSION = '0.4.0'
4
+ VERSION = '0.4.1'
5
5
  end
@@ -35,7 +35,8 @@ module Gbbib
35
35
  end
36
36
 
37
37
  def fetch_committee(doc)
38
- committee = doc.at '/bibitem/gbcommittee'
38
+ committee = doc.at '/bibitem/gbcommittee'
39
+ return nil unless committee
39
40
  { type: committee[:type], name: committee.text }
40
41
  end
41
42
 
@@ -46,9 +47,9 @@ module Gbbib
46
47
  def fetch_gbtype(doc)
47
48
  gbtype = doc.at '/bibitem/gbtype'
48
49
  {
49
- scope: gbtype.at('gbscope').text,
50
- prefix: gbtype.at('gbprefix').text,
51
- mandate: gbtype.at('gbmandate').text
50
+ scope: gbtype&.at('gbscope')&.text,
51
+ prefix: gbtype&.at('gbprefix')&.text,
52
+ mandate: gbtype&.at('gbmandate')&.text
52
53
  }
53
54
  end
54
55
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gbbib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-17 00:00:00.000000000 Z
11
+ date: 2018-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.4.1
117
+ version: 0.4.2
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.4.1
124
+ version: 0.4.2
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: gb-agencies
127
127
  requirement: !ruby/object:Gem::Requirement