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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5d9ccc48e23558a34cc5af40c8603e64cf7a4ea5d51d7996ea17a4996cfaeec
4
- data.tar.gz: fa28142b10ee1ef854584ee52854642305c86ad78ff32dc059f30315783ccd9b
3
+ metadata.gz: 5c9e267804ed407243d999f68830546b55db550bd511fa9146ab87e2db146c1d
4
+ data.tar.gz: c52daf864de7aeacd2651ca1a5442c0cadd8982e43ff671ae8a730a8a9559096
5
5
  SHA512:
6
- metadata.gz: b304791f0d90fa0f23c378d30988f7ef1fa4d2abd36c2487fae454bba257019c0811f31354b94d8fb756dfb26eced93ac251d2ba5e64a41edfbc4268129edb08
7
- data.tar.gz: 4535c1832d38d37f7df709abac6cc52e446f1da1be1704a8a3e4eaa0a98b47667976f88410bf54b73e6e10f50fa5f0807891f23775af772e6ff6d42ee54db18b
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
- (\/(?<corr1>(Amd|Cor)\s?\d+))?
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 == code2 &&
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
 
@@ -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"
@@ -1,3 +1,3 @@
1
1
  module RelatonItu
2
- VERSION = "1.7.6".freeze
2
+ VERSION = "1.7.7".freeze
3
3
  end
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.6
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-12 00:00:00.000000000 Z
11
+ date: 2021-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml