relaton-itu 0.3.7 → 0.3.8

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: 423ebe24fe299d2cc92c42e247fef71bbd12ccb1e3a89c71f9bb349106c0b656
4
- data.tar.gz: 84e2c770897cbd8f39277d1ea8f4a5cd607e6cbd5ceff2c3541fce9155a6e2e9
3
+ metadata.gz: af7a818e18ffa5fccfeef423545ad4c32b0d6dcb1fe644009c15bdd10b0fd2ee
4
+ data.tar.gz: 380ee25d72296884a4f939a68ce59e38cd888c39358fa37dc44dd36acc1543e2
5
5
  SHA512:
6
- metadata.gz: 5d53c2bb5bc82ff0a5a6b26ec2af4d2ad412483e16920897140eb8d1adcd4428811db88713b6dedaf8023167f88a085cc39fdd197338d8b69dd7277d5535a619
7
- data.tar.gz: dd13256931894ccf4a2e3c19bbc02c1a76f8bc41c326bb0916e0fd08e7a8e38cb41e48f892d90f16646d59ddc77e8b5539c3dc84f34efcb39686050a2278eead
6
+ metadata.gz: ff1799f1140844c073ace47166272f8dba321ed606f17699122dd6f668c9746eea6cafaf52c0d55e84ed827ccf5b0f90a2f293c6b1de4f0d43a37415b9aa77ab
7
+ data.tar.gz: f263ec16e358948b32d49947cd2f7861a9f8b4635efea78250927587e72eb37c3a6fbf7e0c50a3e9784838fa074224612dedc6f5effdfda36c72281ba1ec33cf
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaton-itu (0.3.7)
4
+ relaton-itu (0.3.8)
5
5
  relaton-iso-bib (~> 0.3.0)
6
6
 
7
7
  GEM
@@ -87,4 +87,4 @@ DEPENDENCIES
87
87
  webmock
88
88
 
89
89
  BUNDLED WITH
90
- 2.0.1
90
+ 2.0.2
@@ -75,7 +75,7 @@ module RelatonItu
75
75
  end
76
76
 
77
77
  def search_filter(code)
78
- docidrx = %r{\w+.\d+} # %r{^ITU-T\s[^\s]+}
78
+ docidrx = %r{\w+.\d+|\w\sSuppl\.\s\d+} # %r{^ITU-T\s[^\s]+}
79
79
  c = code.match(docidrx).to_s
80
80
  warn "fetching #{code}..."
81
81
  result = search(code)
@@ -65,7 +65,7 @@ module RelatonItu
65
65
  ics: [], # fetch_ics(doc),
66
66
  date: fetch_dates(doc),
67
67
  contributor: fetch_contributors(hit_data[:code]),
68
- editorialgroup: fetch_workgroup(doc),
68
+ editorialgroup: fetch_workgroup(hit_data[:code], doc),
69
69
  abstract: fetch_abstract(doc),
70
70
  copyright: fetch_copyright(hit_data[:code], doc),
71
71
  link: fetch_link(doc, url),
@@ -153,16 +153,17 @@ module RelatonItu
153
153
  end
154
154
 
155
155
  # Fetch workgroup.
156
+ # @param code [String]
156
157
  # @param doc [Nokogiri::HTML::Document]
157
158
  # @return [RelatonItu::EditorialGroup, NilClass]
158
- def fetch_workgroup(doc)
159
+ def fetch_workgroup(code, doc)
159
160
  wg = doc.at('//table/tr/td/span[contains(@id, "Label8")]/a')
160
- return unless wg
161
+ # return unless wg
161
162
 
162
- workgroup = wg.text
163
+ group = wg && itugroup(wg.text)
163
164
  EditorialGroup.new(
164
- bureau: workgroup.match(/(?<=-)./).to_s,
165
- group: itugroup(workgroup),
165
+ bureau: code.match(/(?<=-)./).to_s,
166
+ group: group,
166
167
  )
167
168
  end
168
169
 
@@ -247,7 +248,7 @@ module RelatonItu
247
248
  dates = []
248
249
  pdate = doc.at("//table/tr/td/span[contains(@id, 'Label5')]")
249
250
  publish_date = pdate&.text || ob_date(doc)
250
- unless publish_date.empty?
251
+ unless publish_date&.empty?
251
252
  dates << { type: "published", on: publish_date }
252
253
  end
253
254
  dates
@@ -1,3 +1,3 @@
1
1
  module RelatonItu
2
- VERSION = "0.3.7".freeze
2
+ VERSION = "0.3.8".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: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-31 00:00:00.000000000 Z
11
+ date: 2019-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler