relaton-un 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 +4 -4
- data/Gemfile +1 -1
- data/grammars/biblio.rng +5 -3
- data/lib/relaton_un/hit.rb +3 -1
- data/lib/relaton_un/hit_collection.rb +8 -7
- data/lib/relaton_un/version.rb +1 -1
- data/relaton_un.gemspec +1 -2
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4e4c99e686c0404548000a0a43cde77f7e5596a7f4a00bf6366a820850717e8
|
4
|
+
data.tar.gz: 971ce2228135c5755f20eb67883c213f7d4a75cd2749b6ce824a7453226874bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43872981020e361dcbc7fe270a1f2d859ae2d923e52e44997229232b05d485d6f1b66449067aba7f0168daa78b65221163bc67943bc49a5deb5214d719acf2f8
|
7
|
+
data.tar.gz: aa280783dc71bed1b0b298006ed354256cf4f3e12fdf9dbd2c65967499b6bb27191d578af07325bf25326d5f4cd4c8a60f07b92178ad8c3e93ab36afa425e5e1
|
data/Gemfile
CHANGED
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>
|
data/lib/relaton_un/hit.rb
CHANGED
@@ -82,9 +82,11 @@ module RelatonUn
|
|
82
82
|
|
83
83
|
# @return [Array<RelatonBib::DocumentIdentifier>]
|
84
84
|
def fetch_docid
|
85
|
-
hit[:symbol].map do |s|
|
85
|
+
dids = hit[:symbol].map do |s|
|
86
86
|
RelatonBib::DocumentIdentifier.new(id: s, type: "UN")
|
87
87
|
end
|
88
|
+
dids.first.instance_variable_set :@primary, true
|
89
|
+
dids
|
88
90
|
end
|
89
91
|
|
90
92
|
# @return [Array<RelatonBib::TypedTitleString>]
|
@@ -12,7 +12,7 @@ module RelatonUn
|
|
12
12
|
BOUNDARY = "----WebKitFormBoundaryVarT9Z7AFUzw2lma"
|
13
13
|
|
14
14
|
# @param text [String] reference to search
|
15
|
-
def initialize(text)
|
15
|
+
def initialize(text) # rubocop:disable Metrics/AbcSize
|
16
16
|
super
|
17
17
|
@uri = URI.parse DOMAIN
|
18
18
|
@jar = HTTP::CookieJar.new
|
@@ -58,13 +58,12 @@ module RelatonUn
|
|
58
58
|
"//input[@type!='radio']|"\
|
59
59
|
"//input[@type='radio'][@checked]|"\
|
60
60
|
"//select[@name!='view:_id1:_id2:cbLang']|"\
|
61
|
-
"//textarea"
|
61
|
+
"//textarea",
|
62
62
|
).reduce([]) do |m, i|
|
63
63
|
v = case i[:name]
|
64
64
|
when "view:_id1:_id2:txtSymbol" then text
|
65
|
-
when "view:_id1:_id2:rgTrunc" then "R"
|
65
|
+
when "view:_id1:_id2:rgTrunc", "view:_id1:_id2:cbSort" then "R"
|
66
66
|
when "view:_id1:_id2:cbType" then "FP"
|
67
|
-
when "view:_id1:_id2:cbSort" then "R"
|
68
67
|
when "$$xspsubmitid" then "view:_id1:_id2:_id130"
|
69
68
|
when "$$xspsubmitscroll" then "0|102"
|
70
69
|
when "view:_id1" then "view:_id1"
|
@@ -80,7 +79,7 @@ module RelatonUn
|
|
80
79
|
# @param form_resp [Net::HTTPOK]
|
81
80
|
# @param text [String]
|
82
81
|
# @return [Net::HTTPOK]
|
83
|
-
def page_resp(form_resp, text)
|
82
|
+
def page_resp(form_resp, text) # rubocop:disable Metrics/AbcSize
|
84
83
|
form = Nokogiri::HTML form_resp.body
|
85
84
|
req = Net::HTTP::Post.new form.at("//form")[:action]
|
86
85
|
set_headers req
|
@@ -118,8 +117,10 @@ module RelatonUn
|
|
118
117
|
# @param item [Nokogiri::XML::Element]
|
119
118
|
# @return [String]
|
120
119
|
def symbol(item)
|
121
|
-
item.xpath(
|
122
|
-
"
|
120
|
+
item.xpath(
|
121
|
+
"div/div[not(contains(@class, 'hidden'))]/"\
|
122
|
+
"label[contains(.,'Symbol')]/following-sibling::span[1]",
|
123
|
+
).map &:text
|
123
124
|
end
|
124
125
|
|
125
126
|
# @param item [Nokogiri::XML::Element]
|
data/lib/relaton_un/version.rb
CHANGED
data/relaton_un.gemspec
CHANGED
@@ -33,7 +33,6 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.require_paths = ["lib"]
|
34
34
|
|
35
35
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
36
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
37
36
|
spec.add_development_dependency "ruby-jing"
|
38
37
|
spec.add_development_dependency "simplecov"
|
39
38
|
spec.add_development_dependency "vcr"
|
@@ -41,7 +40,7 @@ Gem::Specification.new do |spec|
|
|
41
40
|
|
42
41
|
spec.add_dependency "faraday"
|
43
42
|
spec.add_dependency "http-cookie"
|
44
|
-
spec.add_dependency "relaton-bib", "~> 1.10.
|
43
|
+
spec.add_dependency "relaton-bib", "~> 1.10.1"
|
45
44
|
spec.add_dependency "unf_ext", ">= 0.0.7.7"
|
46
45
|
end
|
47
46
|
# rubocop:enable Metrics/BlockLength
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-un
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
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-
|
11
|
+
date: 2022-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.6'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: ruby-jing
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +114,14 @@ dependencies:
|
|
128
114
|
requirements:
|
129
115
|
- - "~>"
|
130
116
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.10.
|
117
|
+
version: 1.10.1
|
132
118
|
type: :runtime
|
133
119
|
prerelease: false
|
134
120
|
version_requirements: !ruby/object:Gem::Requirement
|
135
121
|
requirements:
|
136
122
|
- - "~>"
|
137
123
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.10.
|
124
|
+
version: 1.10.1
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
126
|
name: unf_ext
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|