relaton-itu 1.14.0 → 1.14.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: ef87fd606902663b9e0236740fabc892089c45496363a7e2130d5575592a0e07
4
- data.tar.gz: f283ad42e01ffc75850880b4bb224e601db7db1c3df71fe883800c1b4ba3d382
3
+ metadata.gz: 9c4af93cb7f6ba7f9beff7222f442fb1d0b17ad382308fd492fadbbe7932cd69
4
+ data.tar.gz: c19c46f3a457914f60cab5992a1443ccf22242ae9ba7c62d141f4de7bdd23fa2
5
5
  SHA512:
6
- metadata.gz: 99e6637a4eaa1121993c22ff14a4c3dc5a2e00a875b86ee8187b39d81025ac28d3771dca370e9f2c5b2f42be9e77c37e8a4b9576952c5facecf0b407d5e730b5
7
- data.tar.gz: 57e935f3354bf931bcb5cf6ad851b113139ef25100e9e78a8d8766d193dfbb002c801daa698807e5e2844c43b69128a0cbdef1c411de2599dcc5fc028733932f
6
+ metadata.gz: addf42eb6f8631ed0f37fdcfc662edcab0b8877c9316c661b7168e6af64b9e584b23787bf9d5d59372da60f19c7468b378f896279ca6b39d6139c1791f023dc5
7
+ data.tar.gz: 6789334b80124b7a9bbe33631379a952db3849cd34aa46c2bcbdb922f3f9393e65cb93120cd72b35d3590ab3e0f5b42595c3be815db9ca15042d1bb1e8a42332
data/Gemfile CHANGED
@@ -4,3 +4,9 @@ Encoding.default_internal = Encoding::UTF_8
4
4
  source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in relaton_itu.gemspec
6
6
  gemspec
7
+
8
+ gem "pry-byebug"
9
+ gem "ruby-jing"
10
+ gem "simplecov"
11
+ gem "vcr"
12
+ gem "webmock"
@@ -522,7 +522,6 @@
522
522
  <value>tip</value>
523
523
  <value>important</value>
524
524
  <value>caution</value>
525
- <value>statement</value>
526
525
  </choice>
527
526
  </define>
528
527
  <define name="figure">
data/grammars/biblio.rng CHANGED
@@ -216,6 +216,9 @@
216
216
  <optional>
217
217
  <ref name="fullname"/>
218
218
  </optional>
219
+ <zeroOrMore>
220
+ <ref name="credential"/>
221
+ </zeroOrMore>
219
222
  <zeroOrMore>
220
223
  <ref name="affiliation"/>
221
224
  </zeroOrMore>
@@ -232,6 +235,11 @@
232
235
  <ref name="FullNameType"/>
233
236
  </element>
234
237
  </define>
238
+ <define name="credential">
239
+ <element name="credential">
240
+ <text/>
241
+ </element>
242
+ </define>
235
243
  <define name="FullNameType">
236
244
  <choice>
237
245
  <group>
@@ -305,7 +313,9 @@
305
313
  <zeroOrMore>
306
314
  <ref name="affiliationdescription"/>
307
315
  </zeroOrMore>
308
- <ref name="organization"/>
316
+ <optional>
317
+ <ref name="organization"/>
318
+ </optional>
309
319
  </element>
310
320
  </define>
311
321
  <define name="affiliationname">
@@ -1316,7 +1326,7 @@
1316
1326
  <value>commentaryOf</value>
1317
1327
  <value>hasCommentary</value>
1318
1328
  <value>related</value>
1319
- <value>complements</value>
1329
+ <value>hasComplement</value>
1320
1330
  <value>complementOf</value>
1321
1331
  <value>obsoletes</value>
1322
1332
  <value>obsoletedBy</value>
@@ -35,9 +35,9 @@ module RelatonItu
35
35
  private
36
36
 
37
37
  def request_search
38
- url = "#{DOMAIN}/net4/ITU-T/search/GlobalSearch/Search"
38
+ url = "#{DOMAIN}/net4/ITU-T/search/GlobalSearch/RunSearch"
39
39
  data = { json: params.to_json }
40
- resp = agent.post url, data.to_json, "Content-Type" => "application/json"
40
+ resp = agent.post url, data
41
41
  @array = hits JSON.parse(resp.body)
42
42
  end
43
43
 
@@ -55,6 +55,7 @@ module RelatonItu
55
55
 
56
56
  hash = YAML.safe_load resp.body
57
57
  item_hash = HashConverter.hash_to_bib(hash)
58
+ item_hash[:fetched] = Date.today.to_s
58
59
  item = ItuBibliographicItem.new(**item_hash)
59
60
  hit = Hit.new({ url: uri.to_s }, self)
60
61
  hit.fetch = item
@@ -88,7 +89,7 @@ module RelatonItu
88
89
  "Selected" => false,
89
90
  "Value" => "",
90
91
  "Label" => "Name",
91
- "Target" => "\\/name_s",
92
+ "Target" => "/name_s",
92
93
  "TypeName" => "CHECKBOX",
93
94
  "GetCriteriaType" => 0,
94
95
  },
@@ -96,7 +97,7 @@ module RelatonItu
96
97
  "Selected" => false,
97
98
  "Value" => "",
98
99
  "Label" => "Short description",
99
- "Target" => "\\/short_description_s",
100
+ "Target" => "/short_description_s",
100
101
  "TypeName" => "CHECKBOX",
101
102
  "GetCriteriaType" => 0,
102
103
  },
@@ -104,7 +105,7 @@ module RelatonItu
104
105
  "Selected" => false,
105
106
  "Value" => "",
106
107
  "Label" => "File content",
107
- "Target" => "\\/file",
108
+ "Target" => "/file",
108
109
  "TypeName" => "CHECKBOX",
109
110
  "GetCriteriaType" => 0,
110
111
  },
@@ -125,7 +126,7 @@ module RelatonItu
125
126
  data["results"].map do |h|
126
127
  code = h["Media"]["Name"]
127
128
  title = h["Title"]
128
- url = h["Redirection"]
129
+ url = "#{DOMAIN}#{h['Redirection']}"
129
130
  type = h["Collection"]["Group"].downcase[0...-1]
130
131
  Hit.new({ code: code, title: title, url: url, type: type }, self)
131
132
  end
@@ -59,19 +59,19 @@ module RelatonItu
59
59
 
60
60
  def fetch_ref_err(code, year, missed_years) # rubocop:disable Metrics/MethodLength
61
61
  id = year ? "#{code}:#{year}" : code
62
- warn "[relaton-itu] WARNING: no match found online for #{id}. "\
63
- "The code must be exactly like it is on the standards website."
62
+ warn "[relaton-itu] WARNING: no match found online for #{id}. " \
63
+ "The code must be exactly like it is on the standards website."
64
64
  unless missed_years.empty?
65
- warn "[relaton-itu] (There was no match for #{year}, though there "\
66
- "were matches found for #{missed_years.join(', ')}.)"
65
+ warn "[relaton-itu] (There was no match for #{year}, though there " \
66
+ "were matches found for #{missed_years.join(', ')}.)"
67
67
  end
68
68
  if /\d-\d/.match? code
69
- warn "[relaton-itu] The provided document part may not exist, or "\
70
- "the document may no longer be published in parts."
69
+ warn "[relaton-itu] The provided document part may not exist, or " \
70
+ "the document may no longer be published in parts."
71
71
  else
72
- warn "[relaton-itu] If you wanted to cite all document parts for the reference, "\
73
- "use \"#{code} (all parts)\".\nIf the document is not a standard, "\
74
- "use its document type abbreviation (TS, TR, PAS, Guide)."
72
+ warn "[relaton-itu] If you wanted to cite all document parts for the reference, " \
73
+ "use \"#{code} (all parts)\".\nIf the document is not a standard, " \
74
+ "use its document type abbreviation (TS, TR, PAS, Guide)."
75
75
  end
76
76
  nil
77
77
  end
@@ -190,7 +190,7 @@ module RelatonItu
190
190
  did = RelatonBib::DocumentIdentifier.new(id: ref.text, type: "ITU")
191
191
  bibitem = ItuBibliographicItem.new(formattedref: fref, docid: [did],
192
192
  type: "standard")
193
- { type: "complements", bibitem: bibitem }
193
+ { type: "complementOf", bibitem: bibitem }
194
194
  end
195
195
  end
196
196
 
@@ -1,3 +1,3 @@
1
1
  module RelatonItu
2
- VERSION = "1.14.0".freeze
2
+ VERSION = "1.14.1".freeze
3
3
  end
data/relaton-itu.gemspec CHANGED
@@ -27,13 +27,8 @@ Gem::Specification.new do |spec|
27
27
  spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
28
28
 
29
29
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
30
- spec.add_development_dependency "pry-byebug"
31
30
  spec.add_development_dependency "rake", "~> 13.0"
32
31
  spec.add_development_dependency "rspec", "~> 3.0"
33
- spec.add_development_dependency "ruby-jing"
34
- spec.add_development_dependency "simplecov"
35
- spec.add_development_dependency "vcr", "~> 5.0.0"
36
- spec.add_development_dependency "webmock"
37
32
 
38
33
  spec.add_dependency "mechanize", "~> 2.8.0"
39
34
  spec.add_dependency "relaton-bib", "~> 1.14.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.0
4
+ version: 1.14.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-12-05 00:00:00.000000000 Z
11
+ date: 2023-04-09 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: pry-byebug
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rake
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,62 +52,6 @@ dependencies:
66
52
  - - "~>"
67
53
  - !ruby/object:Gem::Version
68
54
  version: '3.0'
69
- - !ruby/object:Gem::Dependency
70
- name: ruby-jing
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: simplecov
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: vcr
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 5.0.0
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 5.0.0
111
- - !ruby/object:Gem::Dependency
112
- name: webmock
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
55
  - !ruby/object:Gem::Dependency
126
56
  name: mechanize
127
57
  requirement: !ruby/object:Gem::Requirement