relaton-calconnect 1.10.0 → 1.10.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: fc6f1d7dfe13d3c4db9b18e95dc9f5aed1bedefd19213c70dbd873de26a38ce2
4
- data.tar.gz: bab5ad5fec02754e549f7a35f488a985d03947c5a428fe6b02438a2a1cc54d3f
3
+ metadata.gz: 28f0818beb318356e6c98999c461cfa4abfd2582f22771e42c93679b79acc0b6
4
+ data.tar.gz: 629eec258bb6b2ab488cb50731ec8a49248ea2b52fea97d8628f51dca3a495ba
5
5
  SHA512:
6
- metadata.gz: 902f6d7353903a53cd1739d7a094c2be8d72fe94b73066bd849559463a368060d4692542cbc48c49764b128be44e3e83177e5d18c0e0ae8c88bbc491484f586b
7
- data.tar.gz: ca2dcfca25d202703a3a32032880b82532e7c75a7395582bcbdac6314c71a92c0c5fe2bd5d8a62b737c20e6d51c2188d2f33970b833fb4368f99a2840371a038
6
+ metadata.gz: 1c2ee52411505f9e208aee08277ba956d66c74ddce6cdaa4b78700ac906ddc1caeaf10951f05e20a9e3666486d24c4fe5f4a763217ca0e5a073326f3ccc668e4
7
+ data.tar.gz: 83c61bb0b56e315db85647b46a889d8ec506905d9019ed675d4de31d1508500340d0b61a8df6ddcad21f29df828323c3b624694434f62f23fc0e2509c4854144
data/grammars/biblio.rng CHANGED
@@ -209,9 +209,6 @@
209
209
  <zeroOrMore>
210
210
  <ref name="contact"/>
211
211
  </zeroOrMore>
212
- <zeroOrMore>
213
- <ref name="uri"/>
214
- </zeroOrMore>
215
212
  </element>
216
213
  </define>
217
214
  <define name="fullname">
@@ -828,6 +825,11 @@
828
825
  <optional>
829
826
  <attribute name="scope"/>
830
827
  </optional>
828
+ <optional>
829
+ <attribute name="primary">
830
+ <data type="boolean"/>
831
+ </attribute>
832
+ </optional>
831
833
  <text/>
832
834
  </element>
833
835
  </define>
@@ -7,7 +7,7 @@ module RelatonCalconnect
7
7
  class << self
8
8
  # papam hit [Hash]
9
9
  # @return [RelatonOgc::OrcBibliographicItem]
10
- def parse_page(hit)
10
+ def parse_page(hit) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
11
11
  links = array(hit["link"])
12
12
  link = links.detect { |l| l["type"] == "rxl" }
13
13
  if link
@@ -15,9 +15,11 @@ module RelatonCalconnect
15
15
  update_links bib, links
16
16
  # XMLParser.from_xml bib_xml
17
17
  else
18
- bib = RelatonCalconnect::CcBibliographicItem.from_hash doc_to_hash(hit)
18
+ bib = RelatonCalconnect::CcBibliographicItem.from_hash doc_to_hash hit
19
+ end
20
+ bib.link.each do |l|
21
+ l.content.merge!(scheme: SCHEME, host: HOST) unless l.content.host
19
22
  end
20
- bib.link.each { |l| l.content.merge!(scheme: SCHEME, host: HOST) unless l.content.host }
21
23
  bib
22
24
  end
23
25
 
@@ -25,16 +27,7 @@ module RelatonCalconnect
25
27
 
26
28
  # @param url [String]
27
29
  # @return [String] XML
28
- def fetch_bib_xml(url)
29
- # rxl = get_rxl url
30
- # uri_rxl = rxl.at("uri[@type='rxl']")
31
- # return rxl.to_xml unless uri_rxl
32
-
33
- # uri_xml = rxl.xpath("//uri").to_xml
34
- # rxl = get_rxl uri_rxl.text
35
- # docid = rxl.at "//docidentifier"
36
- # docid.add_previous_sibling uri_xml
37
- # rxl.to_xml
30
+ def fetch_bib_xml(url) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
38
31
  rxl = get_rxl url
39
32
  uri_rxl = rxl.at("uri[@type='rxl']")
40
33
  if uri_rxl
@@ -44,6 +37,7 @@ module RelatonCalconnect
44
37
  docid.add_previous_sibling uri_xml
45
38
  end
46
39
  xml = rxl.to_xml.gsub!(%r{(</?)technical-committee(>)}, '\1committee\2')
40
+ .gsub(%r{type="(?:csd|CC)"(?=>)}i, '\0 primary="true"')
47
41
  RelatonCalconnect::XMLParser.from_xml xml
48
42
  end
49
43
 
@@ -66,6 +60,8 @@ module RelatonCalconnect
66
60
  tc = eg.delete("technical_committee")
67
61
  eg.merge!(tc) if tc
68
62
  end
63
+ dtps = %w[CC CSD]
64
+ array(doc["docid"]).detect { |id| dtps.include? id["type"].upcase }["primary"] = true
69
65
  doc
70
66
  end
71
67
 
@@ -1,3 +1,3 @@
1
1
  module RelatonCalconnect
2
- VERSION = "1.10.0".freeze
2
+ VERSION = "1.10.1".freeze
3
3
  end
@@ -35,5 +35,5 @@ Gem::Specification.new do |spec|
35
35
  spec.add_development_dependency "webmock"
36
36
 
37
37
  spec.add_dependency "faraday"
38
- spec.add_dependency "relaton-bib", "~> 1.10.0"
38
+ spec.add_dependency "relaton-bib", "~> 1.10.1"
39
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-calconnect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.10.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: 2022-01-30 00:00:00.000000000 Z
11
+ date: 2022-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 1.10.0
131
+ version: 1.10.1
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 1.10.0
138
+ version: 1.10.1
139
139
  description: 'RelatonIso: retrieve CC Standards for bibliographic use using the IsoBibliographicItem
140
140
  model'
141
141
  email: