relaton-itu 1.7.6 → 1.7.7
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 +4 -4
- data/lib/relaton_itu/itu_bibliography.rb +11 -4
- data/lib/relaton_itu/scrapper.rb +1 -1
- data/lib/relaton_itu/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5c9e267804ed407243d999f68830546b55db550bd511fa9146ab87e2db146c1d
|
|
4
|
+
data.tar.gz: c52daf864de7aeacd2651ca1a5442c0cadd8982e43ff671ae8a730a8a9559096
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e412c86f5a31146d27ae6b05feef03c817e2004581efde5e3051a66b37fe061c1e984e417ba92e94ca15032bab17c3e6f70a2062842922c4b300dfc4224cac61
|
|
7
|
+
data.tar.gz: e6718282c40d4119d1b7f33bc0f553c611b87d8f46abe57ddf7eb8569f781d22fa54ea135808d7b895d2b9b48b267eafac4d8d25a43df841b35d21d5041dcaea
|
|
@@ -77,10 +77,11 @@ module RelatonItu
|
|
|
77
77
|
|
|
78
78
|
def search_filter(code, year) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
|
|
79
79
|
%r{
|
|
80
|
-
^(?<pref1>ITU)?(-(?<type1>\w))?\s?(?<code1>[^\s\/]+(?:\/\w\.\d+)?)
|
|
80
|
+
^(?<pref1>ITU)?(-(?<type1>\w))?\s?(?<code1>[^\s\/]+(?:\/\w[\.\d]+)?)
|
|
81
|
+
(\s\(?(?<ver1>v\d+)\)?)?
|
|
81
82
|
(\s\(((?<month1>\d{2})\/)?(?<year1>\d{4})\))?
|
|
82
83
|
(\s-\s(?<buldate1>\d{2}\.\w{1,4}\.\d{4}))?
|
|
83
|
-
(
|
|
84
|
+
(\s(?<corr1>(Amd|Cor|Amendment|Corrigendum)\.?\s?\d+))?
|
|
84
85
|
(\s\(((?<cormonth1>\d{2})\/)?(?<coryear1>\d{4})\))?
|
|
85
86
|
}x =~ code
|
|
86
87
|
year ||= year1
|
|
@@ -89,21 +90,27 @@ module RelatonItu
|
|
|
89
90
|
warn "[relaton-itu] (\"#{code}\") fetching..."
|
|
90
91
|
result = search(code)
|
|
91
92
|
code1.sub! /(?<=\.)Imp(?=\d)/, "" if result.gi_imp
|
|
93
|
+
if corr1
|
|
94
|
+
corr1.sub!(/[\.\s]+/, " ").sub!("Amendment", "Amd")
|
|
95
|
+
corr1.sub!("Corrigendum", "Corr")
|
|
96
|
+
end
|
|
92
97
|
result.select do |i|
|
|
93
98
|
next true unless i.hit[:code]
|
|
94
99
|
|
|
95
100
|
%r{
|
|
96
101
|
^(?<pref2>ITU)?(-(?<type2>\w))?\s?(?<code2>[\S]+)
|
|
102
|
+
(\s\(?(?<ver2>v\d+)\)?)?
|
|
97
103
|
(\s\(((?<month2>\d{2})\/)?(?<year2>\d{4})\))?
|
|
98
104
|
(\s(?<corr2>(Amd|Cor)\.\s?\d+))?
|
|
99
105
|
(\s\(((?<cormonth2>\d{2})\/)?(?<coryear2>\d{4})\))?
|
|
100
106
|
}x =~ i.hit[:code]
|
|
101
107
|
/:[^\(]+\((?<buldate2>\d{2}\.\w{1,4}\.\d{4})\)/ =~ i.hit[:title]
|
|
102
108
|
corr2&.sub! /\.\s?/, " "
|
|
103
|
-
pref1 == pref2 && (!type1 || type1 == type2) && code1
|
|
109
|
+
pref1 == pref2 && (!type1 || type1 == type2) && code2.include?(code1) &&
|
|
104
110
|
(!year || year == year2) && (!month1 || month1 == month2) &&
|
|
105
111
|
corr1 == corr2 && (!coryear1 || coryear1 == coryear2) &&
|
|
106
|
-
buldate1 == buldate2 && (!cormonth1 || cormonth1 == cormonth2)
|
|
112
|
+
buldate1 == buldate2 && (!cormonth1 || cormonth1 == cormonth2) &&
|
|
113
|
+
(!ver1 || ver1 == ver2)
|
|
107
114
|
end
|
|
108
115
|
end
|
|
109
116
|
|
data/lib/relaton_itu/scrapper.rb
CHANGED
|
@@ -132,7 +132,7 @@ module RelatonItu
|
|
|
132
132
|
# (\s\(((?<_cormonth>\d{2})\/)?(?<_coryear>\d{4})\))?
|
|
133
133
|
}x =~ text.squeeze(" ")
|
|
134
134
|
corr&.sub! /\.\s?/, " "
|
|
135
|
-
id = [code.sub(/[[:space:]]$/, ""), corr].compact.join "
|
|
135
|
+
id = [code.sub(/[[:space:]]$/, ""), corr].compact.join " "
|
|
136
136
|
id += " - #{buldate}" if buldate
|
|
137
137
|
type = id.match(%r{^\w+}).to_s
|
|
138
138
|
type = "ITU" if type == "G"
|
data/lib/relaton_itu/version.rb
CHANGED
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.7.
|
|
4
|
+
version: 1.7.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-04-
|
|
11
|
+
date: 2021-04-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: equivalent-xml
|