relaton-nist 0.3.1 → 0.3.2

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
  SHA1:
3
- metadata.gz: 147749e057ac3bdfed497ab88ba83931df9a6f01
4
- data.tar.gz: 913e28a5f496a8aa48b21e8fb81d8107eb629d6b
3
+ metadata.gz: 2eafbe4c1cb7719d3f782f77547db4b759bd8c41
4
+ data.tar.gz: 912039be62b33bdf6fab94966614e5de7adea3ac
5
5
  SHA512:
6
- metadata.gz: 6037679e600a3656512514dcad74adcab91eaa9bfa85e87f39e564f1c7f80007e4598693fd80654e6ef44fa6e1b913b2b0f0c266dd381940dad1288eeb692fea
7
- data.tar.gz: bb8d3ec45f4eb94e647dc747a16bad03b2d4349a5b0519ecbf8eb7b639791c7b5d4a2c4836c5251428ff774ec579a402f6aeb818722b6feaa6393dd17bcec33c
6
+ metadata.gz: e49aaf8910c7fc910da3f7581fd4f6dcc3fb9beb0dba9575ca266d4bc5edf2d9a0b013470308553c9a30f563aad84c5c7ae9d85ccbc4715bc8480e7bcb27ccc4
7
+ data.tar.gz: 84105c9c7612a47a9f3d6bebd873434147fa5a8e9ba0bedcc8ff0961939902eaf087fd3d08682eb2e45cbec10c262afabb4c5ec364d4f0e44262a061a6507048
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaton-nist (0.3.1)
4
+ relaton-nist (0.3.2)
5
5
  relaton-bib (~> 0.3.0)
6
6
  rubyzip
7
7
 
@@ -25,7 +25,7 @@ GEM
25
25
  json (2.2.0)
26
26
  method_source (0.9.2)
27
27
  mini_portile2 (2.4.0)
28
- nokogiri (1.10.3)
28
+ nokogiri (1.10.4)
29
29
  mini_portile2 (~> 2.4.0)
30
30
  pry (0.12.2)
31
31
  coderay (~> 1.1.0)
@@ -35,7 +35,7 @@ GEM
35
35
  pry (~> 0.10)
36
36
  public_suffix (3.1.1)
37
37
  rake (10.5.0)
38
- relaton-bib (0.3.2)
38
+ relaton-bib (0.3.4)
39
39
  addressable
40
40
  nokogiri (~> 1.10)
41
41
  rspec (3.8.0)
@@ -15,7 +15,7 @@ module RelatonNist
15
15
  # @return [RelatonNist::HitCollection]
16
16
  def search(text, year = nil, opts = {})
17
17
  HitCollection.new text, year, opts
18
- rescue OpenURI::HTTPError, SocketError
18
+ rescue OpenURI::HTTPError, SocketError, OpenSSL::SSL::SSLError
19
19
  raise RelatonBib::RequestError, "Could not access https://www.nist.gov"
20
20
  end
21
21
 
@@ -34,9 +34,9 @@ module RelatonNist
34
34
  code = code2.strip
35
35
  if date2
36
36
  if /\w+\s\d{4}/ =~ date2
37
- opts[:issued_date] = Time.strptime date2, "%B %Y"
37
+ opts[:issued_date] = Date.strptime date2, "%B %Y"
38
38
  elsif /\w+\s\d{2},\s\d{4}/ =~ date2
39
- opts[:updated_date] = Time.strptime date2, "%B %d, %Y"
39
+ opts[:updated_date] = Date.strptime date2, "%B %d, %Y"
40
40
  end
41
41
  end
42
42
  opts[:stage] = stage if stage
@@ -91,7 +91,8 @@ module RelatonNist
91
91
  resp = Net::HTTP.get_response(uri) # .encode("UTF-8")
92
92
  Nokogiri::HTML(resp.body)
93
93
  rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,
94
- Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError
94
+ Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,
95
+ OpenSSL::SSL::SSLError
95
96
  raise RelatonBib::RequestError, "Could not access #{url}"
96
97
  end
97
98
 
@@ -230,7 +231,7 @@ module RelatonNist
230
231
  )
231
232
  end
232
233
  if contr["surname"]
233
- affiliation = RelatonBib::Affilation.new org
234
+ affiliation = RelatonBib::Affilation.new organization: org
234
235
  entity = RelatonBib::Person.new(
235
236
  name: full_name(contr, lang, script), affiliation: [affiliation],
236
237
  )
@@ -266,7 +267,7 @@ module RelatonNist
266
267
  url = nil
267
268
  end
268
269
  org = RelatonBib::Organization.new name: org_name, url: url, abbreviation: abbrev
269
- affiliation = RelatonBib::Affilation.new org
270
+ affiliation = RelatonBib::Affilation.new organization: org
270
271
  entity = RelatonBib::Person.new(
271
272
  name: fullname, affiliation: [affiliation],
272
273
  )
@@ -1,3 +1,3 @@
1
1
  module RelatonNist
2
- VERSION = "0.3.1".freeze
2
+ VERSION = "0.3.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-nist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
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-08-05 00:00:00.000000000 Z
11
+ date: 2019-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler