fsp_harvester 0.1.21 → 0.1.22

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: 8498c33db9c350fec8ea4e734b31087f798a4f433f211115c69ded468dbcdb12
4
- data.tar.gz: f3f408b24575f4f310c6f00ac0d42c3106f68fcd43199d3dbb73d8e4deb403fe
3
+ metadata.gz: dfe28e2fc429fd0c550539b356e325a1735d323e72fa9c4ee502fbedb1c818df
4
+ data.tar.gz: b1ec033372645ca2129f44c4faad380b690527ab2f0823583985b12328bdce54
5
5
  SHA512:
6
- metadata.gz: 263549dc8b8bf2fe8a4bc50289092ad2e55d9bbc05cabc509637786b4923948345220f0ee7a04fa5db497f670d9ab79d4e35e05648f09f189103ae869040baad
7
- data.tar.gz: 6b35a320400ff37561ddf2cff506a3a4f385cd31933e4df8ceb4d436a4f97974e7122ab96962b8ce3cfc183144fcf41592fa417abcdb609fd44080061fc5e1a3
6
+ metadata.gz: 11b5ce8b8368d70171e3e376ee75275e1c2892ec58be07976fa225a2df1841ae11b06c335105ab1915a001fb1f0e6247fadf00e3d06f33b21918593c3ada5fc0
7
+ data.tar.gz: b0c82ea9e81183789227a22eb3c160bfad5d4aa346f0aebb349b383f3d920877c28addb6f936a8a4f5b59d352bcecd313984f7ef7bb90aa4b5e93653e22fd176
data/.rspec_status CHANGED
@@ -1,60 +1,60 @@
1
1
  example_id | status | run_time |
2
2
  ---------------------------------- | ------ | ---------------------- |
3
- ./spec/cite-as_spec.rb[1:1:1] | passed | 1.77 seconds |
4
- ./spec/cite-as_spec.rb[1:1:2] | passed | 1.22 seconds |
5
- ./spec/cite-as_spec.rb[1:1:3] | passed | 1.09 seconds |
6
- ./spec/cite-as_spec.rb[1:1:4] | passed | 1.89 seconds |
7
- ./spec/cite-as_spec.rb[1:1:5] | passed | 2.95 seconds |
8
- ./spec/cite-as_spec.rb[1:1:6] | passed | 2.14 seconds |
9
- ./spec/cite-as_spec.rb[1:1:7] | passed | 2.96 seconds |
10
- ./spec/cite-as_spec.rb[1:1:8] | passed | 2.28 seconds |
11
- ./spec/cite-as_spec.rb[1:1:9] | passed | 3.4 seconds |
12
- ./spec/cite-as_spec.rb[1:1:10] | passed | 2.21 seconds |
13
- ./spec/cite-as_spec.rb[1:1:11] | passed | 2.82 seconds |
3
+ ./spec/cite-as_spec.rb[1:1:1] | passed | 1.87 seconds |
4
+ ./spec/cite-as_spec.rb[1:1:2] | passed | 1.3 seconds |
5
+ ./spec/cite-as_spec.rb[1:1:3] | passed | 1.53 seconds |
6
+ ./spec/cite-as_spec.rb[1:1:4] | passed | 2.09 seconds |
7
+ ./spec/cite-as_spec.rb[1:1:5] | passed | 8.09 seconds |
8
+ ./spec/cite-as_spec.rb[1:1:6] | passed | 2.63 seconds |
9
+ ./spec/cite-as_spec.rb[1:1:7] | passed | 2.9 seconds |
10
+ ./spec/cite-as_spec.rb[1:1:8] | passed | 2.21 seconds |
11
+ ./spec/cite-as_spec.rb[1:1:9] | passed | 2.85 seconds |
12
+ ./spec/cite-as_spec.rb[1:1:10] | passed | 2.89 seconds |
13
+ ./spec/cite-as_spec.rb[1:1:11] | passed | 3.16 seconds |
14
14
  ./spec/cite-as_spec.rb[1:1:12] | passed | 2.23 seconds |
15
- ./spec/cite-as_spec.rb[1:1:13] | passed | 3.36 seconds |
16
- ./spec/cite-as_spec.rb[1:1:14] | passed | 2.19 seconds |
17
- ./spec/cite-as_spec.rb[1:1:15] | passed | 1.19 seconds |
18
- ./spec/cite-as_spec.rb[1:1:16] | passed | 1.23 seconds |
15
+ ./spec/cite-as_spec.rb[1:1:13] | passed | 2.92 seconds |
16
+ ./spec/cite-as_spec.rb[1:1:14] | passed | 2.8 seconds |
17
+ ./spec/cite-as_spec.rb[1:1:15] | passed | 1.21 seconds |
18
+ ./spec/cite-as_spec.rb[1:1:16] | passed | 1.28 seconds |
19
19
  ./spec/cite-as_spec.rb[1:1:17] | passed | 1.19 seconds |
20
- ./spec/cite-as_spec.rb[1:1:18] | passed | 1.28 seconds |
21
- ./spec/cite-as_spec.rb[1:1:19] | passed | 1.94 seconds |
22
- ./spec/cite-as_spec.rb[1:1:20] | passed | 2.1 seconds |
23
- ./spec/cite-as_spec.rb[1:1:21] | passed | 2.23 seconds |
24
- ./spec/cite-as_spec.rb[1:1:22] | passed | 1.17 seconds |
25
- ./spec/cite-as_spec.rb[1:1:23] | passed | 1.13 seconds |
26
- ./spec/cite-as_spec.rb[1:1:24] | failed | 1.24 seconds |
27
- ./spec/cite-as_spec.rb[1:1:25] | passed | 0.49678 seconds |
28
- ./spec/describedby_spec.rb[1:1:1] | passed | 3.18 seconds |
29
- ./spec/describedby_spec.rb[1:1:2] | passed | 1.34 seconds |
30
- ./spec/describedby_spec.rb[1:1:3] | passed | 1.2 seconds |
31
- ./spec/describedby_spec.rb[1:1:4] | passed | 1.14 seconds |
20
+ ./spec/cite-as_spec.rb[1:1:18] | passed | 1.24 seconds |
21
+ ./spec/cite-as_spec.rb[1:1:19] | passed | 1.7 seconds |
22
+ ./spec/cite-as_spec.rb[1:1:20] | passed | 1.74 seconds |
23
+ ./spec/cite-as_spec.rb[1:1:21] | passed | 2.75 seconds |
24
+ ./spec/cite-as_spec.rb[1:1:22] | passed | 1.35 seconds |
25
+ ./spec/cite-as_spec.rb[1:1:23] | passed | 1.19 seconds |
26
+ ./spec/cite-as_spec.rb[1:1:24] | failed | 1.2 seconds |
27
+ ./spec/cite-as_spec.rb[1:1:25] | passed | 0.60282 seconds |
28
+ ./spec/describedby_spec.rb[1:1:1] | passed | 3.23 seconds |
29
+ ./spec/describedby_spec.rb[1:1:2] | passed | 1.43 seconds |
30
+ ./spec/describedby_spec.rb[1:1:3] | passed | 1.31 seconds |
31
+ ./spec/describedby_spec.rb[1:1:4] | passed | 1.37 seconds |
32
32
  ./spec/describedby_spec.rb[1:1:5] | passed | 1.24 seconds |
33
- ./spec/describedby_spec.rb[1:1:6] | passed | 1.04 seconds |
34
- ./spec/describedby_spec.rb[1:1:7] | passed | 0.9844 seconds |
35
- ./spec/describedby_spec.rb[1:1:8] | passed | 2.07 seconds |
36
- ./spec/describedby_spec.rb[1:1:9] | passed | 2.16 seconds |
37
- ./spec/describedby_spec.rb[1:1:10] | passed | 2.36 seconds |
38
- ./spec/describedby_spec.rb[1:1:11] | passed | 2.91 seconds |
39
- ./spec/describedby_spec.rb[1:1:12] | passed | 2.93 seconds |
40
- ./spec/describedby_spec.rb[1:1:13] | passed | 1.79 seconds |
41
- ./spec/describedby_spec.rb[1:1:14] | passed | 2.5 seconds |
42
- ./spec/describedby_spec.rb[1:1:15] | passed | 2.24 seconds |
43
- ./spec/fsp_harvester_spec.rb[1:1] | passed | 0.00102 seconds |
44
- ./spec/fsp_harvester_spec.rb[1:2] | passed | 2.5 seconds |
45
- ./spec/fsp_harvester_spec.rb[1:3] | passed | 29.49 seconds |
46
- ./spec/fsp_harvester_spec.rb[1:4] | passed | 2.53 seconds |
47
- ./spec/fsp_harvester_spec.rb[1:5] | passed | 2.65 seconds |
48
- ./spec/fsp_harvester_spec.rb[1:6] | failed | 1 minute 24.1 seconds |
49
- ./spec/fsp_harvester_spec.rb[1:7] | passed | 2 minutes 24.3 seconds |
50
- ./spec/item_spec.rb[1:1:1] | passed | 2.71 seconds |
51
- ./spec/item_spec.rb[1:1:2] | passed | 2.98 seconds |
33
+ ./spec/describedby_spec.rb[1:1:6] | passed | 1.09 seconds |
34
+ ./spec/describedby_spec.rb[1:1:7] | passed | 1.03 seconds |
35
+ ./spec/describedby_spec.rb[1:1:8] | passed | 2.28 seconds |
36
+ ./spec/describedby_spec.rb[1:1:9] | passed | 1.84 seconds |
37
+ ./spec/describedby_spec.rb[1:1:10] | passed | 2.23 seconds |
38
+ ./spec/describedby_spec.rb[1:1:11] | passed | 2.97 seconds |
39
+ ./spec/describedby_spec.rb[1:1:12] | passed | 2.97 seconds |
40
+ ./spec/describedby_spec.rb[1:1:13] | passed | 1.65 seconds |
41
+ ./spec/describedby_spec.rb[1:1:14] | passed | 2.27 seconds |
42
+ ./spec/describedby_spec.rb[1:1:15] | passed | 2.53 seconds |
43
+ ./spec/fsp_harvester_spec.rb[1:1] | passed | 0.00025 seconds |
44
+ ./spec/fsp_harvester_spec.rb[1:2] | passed | 2.69 seconds |
45
+ ./spec/fsp_harvester_spec.rb[1:3] | passed | 45.63 seconds |
46
+ ./spec/fsp_harvester_spec.rb[1:4] | passed | 2.86 seconds |
47
+ ./spec/fsp_harvester_spec.rb[1:5] | passed | 2.67 seconds |
48
+ ./spec/fsp_harvester_spec.rb[1:6] | passed | 2 minutes 1.6 seconds |
49
+ ./spec/fsp_harvester_spec.rb[1:7] | passed | 1 minute 28.63 seconds |
50
+ ./spec/item_spec.rb[1:1:1] | passed | 3.8 seconds |
51
+ ./spec/item_spec.rb[1:1:2] | passed | 3.3 seconds |
52
52
  ./spec/item_spec.rb[1:1:3] | passed | 1.33 seconds |
53
- ./spec/item_spec.rb[1:1:4] | passed | 1.81 seconds |
54
- ./spec/item_spec.rb[1:1:5] | passed | 2.2 seconds |
55
- ./spec/item_spec.rb[1:1:6] | passed | 2.25 seconds |
56
- ./spec/item_spec.rb[1:1:7] | passed | 2.94 seconds |
57
- ./spec/item_spec.rb[1:1:8] | passed | 0.62818 seconds |
58
- ./spec/type_spec.rb[1:1:1] | passed | 1.33 seconds |
59
- ./spec/type_spec.rb[1:1:2] | passed | 1.22 seconds |
60
- ./spec/type_spec.rb[1:1:3] | passed | 1.61 seconds |
53
+ ./spec/item_spec.rb[1:1:4] | passed | 1.68 seconds |
54
+ ./spec/item_spec.rb[1:1:5] | passed | 2.44 seconds |
55
+ ./spec/item_spec.rb[1:1:6] | passed | 2.64 seconds |
56
+ ./spec/item_spec.rb[1:1:7] | passed | 3.02 seconds |
57
+ ./spec/item_spec.rb[1:1:8] | passed | 0.49403 seconds |
58
+ ./spec/type_spec.rb[1:1:1] | passed | 1.23 seconds |
59
+ ./spec/type_spec.rb[1:1:2] | passed | 1.25 seconds |
60
+ ./spec/type_spec.rb[1:1:3] | passed | 1.57 seconds |
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fsp_harvester (0.1.21)
4
+ fsp_harvester (0.1.22)
5
5
  json (~> 2.0)
6
6
  linkeddata (~> 3.2)
7
7
  linkheaders-processor (~> 0.1.18)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FspHarvester
4
- VERSION = "0.1.21"
4
+ VERSION = "0.1.22"
5
5
  end
@@ -153,7 +153,7 @@ module HarvesterTools
153
153
  def self.check_ld(body:, claimed_type:)
154
154
  detected_type = ntriples_hack(body: body) # ntriples hack for one-line metadata records
155
155
  unless detected_type # see if distiller can detect a type
156
- detected_type = RDF::Format.for({ sample: body[0..5000] })
156
+ detected_type = RDF::Format.for({ sample: body[0..5000].force_encoding('UTF-8')})
157
157
  @meta.comments << "INFO: Auto-detected type #{detected_type}\n"
158
158
  end
159
159
  # at this point, detected_type is something like RDF::Turtle::Format (or nil). This will return a content-type
@@ -199,7 +199,7 @@ module HarvesterTools
199
199
  abbreviation = nil
200
200
  parsed = nil
201
201
  begin
202
- parsed = JSON.parse(body)
202
+ parsed = JSON.parse(body.force_encoding('UTF-8'))
203
203
  rescue StandardError
204
204
  abbreviation = nil
205
205
  end
@@ -88,7 +88,7 @@ module HarvesterTools
88
88
  @meta.comments << "INFO: The response message body component appears to contain #{rdfformat}.\n"
89
89
  reader = ''
90
90
  begin
91
- reader = rdfformat.reader.new(body)
91
+ reader = rdfformat.reader.new(body.force_encoding('UTF-8'))
92
92
  rescue Exception => e
93
93
  @meta.comments << "WARN: Though linked data was found, it failed to parse (Exception #{e}). This likely indicates some syntax error in the data. As a result, no metadata will be extracted from this message.\n"
94
94
  @meta.add_warning(['018', '', ''])
@@ -102,9 +102,9 @@ module HarvesterTools
102
102
  end
103
103
  reader = rdfformat.reader.new(body) # have to re-read it here, but now its safe because we have already caught errors
104
104
  warn 'WRITING TO CACHE'
105
- HarvesterTools::Cache.writeRDFCache(reader: reader, body: body) # write to the special RDF graph cache
105
+ HarvesterTools::Cache.writeRDFCache(reader: reader, body: body.force_encoding('UTF-8')) # write to the special RDF graph cache
106
106
  warn 'WRITING DONE'
107
- reader = rdfformat.reader.new(body) # frustrating that we cannot rewind!
107
+ reader = rdfformat.reader.new(body.force_encoding('UTF-8')) # frustrating that we cannot rewind!
108
108
  warn 'RE-READING DONE'
109
109
  @meta.merge_rdf(reader.to_a)
110
110
  warn 'MERGE DONE'
@@ -114,7 +114,7 @@ module HarvesterTools
114
114
  @meta.add_warning(['018', '', ''])
115
115
  rescue Exception => e
116
116
  meta.comments << "CRITICAL: An unknown error occurred while parsing the (apparent) Linked Data (sample of what was parsed: #{body[0..300].delete("\n")}). Moving on...\n"
117
- warn "\n\nCRITICAL: #{e.inspect} An unknown error occurred while parsing the (apparent) Linked Data (full body: #{body}). Moving on...\n"
117
+ warn "\n\nCRITICAL: #{e.inspect} An unknown error occurred while parsing the (apparent) Linked Data (full body: #{body.force_encoding('UTF-8')}). Moving on...\n"
118
118
  @meta.add_warning(['018', '', ''])
119
119
  end
120
120
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fsp_harvester
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.21
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Wilkinson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-18 00:00:00.000000000 Z
11
+ date: 2022-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json