hydra-derivatives 3.3.1 → 3.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 +4 -4
- data/VERSION +1 -1
- data/lib/hydra/derivatives/processors/full_text.rb +3 -0
- data/spec/processors/full_text_spec.rb +11 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3cb485ab21d05631d5c5643d6fe6726d2dc82fb3
|
|
4
|
+
data.tar.gz: 2f30a6f276a10e750bd4d1f5acde291d775e5668
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6b0618b15bb531bbe5d2b476b790b3f26652a8ebab3403a325ff720d2fc16b933de2e8c37e94521eb14e405b1f15ceda036c0ef647808d995e81389fb471a250
|
|
7
|
+
data.tar.gz: 02225a904af793102c24dbd983116640dea8183ce331f0fb40830095d8012466dfe7c5870ca0a6f398956b2bbdaffeaadfa555d1e7a49c8db936caf65e759c6d
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.3.
|
|
1
|
+
3.3.2
|
|
@@ -27,6 +27,9 @@ module Hydra::Derivatives::Processors
|
|
|
27
27
|
raise "Solr Extract service was unsuccessful. '#{uri}' returned code #{resp.code} for #{source_path}\n#{resp.body}" unless resp.code == '200'
|
|
28
28
|
file_content.rewind if file_content.respond_to?(:rewind)
|
|
29
29
|
|
|
30
|
+
if resp.type_params['charset']
|
|
31
|
+
resp.body.force_encoding(resp.type_params['charset'])
|
|
32
|
+
end
|
|
30
33
|
resp.body
|
|
31
34
|
end
|
|
32
35
|
|
|
@@ -28,13 +28,23 @@ describe Hydra::Derivatives::Processors::FullText do
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
context "that is successful" do
|
|
31
|
-
let(:resp) { double(code: '200', body: response_body) }
|
|
31
|
+
let(:resp) { double(code: '200', type_params: {}, body: response_body) }
|
|
32
32
|
it "calls the extraction service" do
|
|
33
33
|
expect(request).to receive(:post).with('http://example.com:99/solr/update', String, "Content-Type" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Content-Length" => "24244").and_return(resp)
|
|
34
34
|
expect(subject).to eq response_body
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
+
context "that is successful with UTF-8 content" do
|
|
39
|
+
let(:response_utf8) { "returned by “Solr”" }
|
|
40
|
+
let(:response_ascii) { response_utf8.dup.force_encoding("ASCII-8BIT") }
|
|
41
|
+
let(:resp) { double(code: '200', type_params: { "charset" => "UTF-8" }, body: response_ascii) }
|
|
42
|
+
it "calls the extraction service" do
|
|
43
|
+
expect(request).to receive(:post).with('http://example.com:99/solr/update', String, "Content-Type" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Content-Length" => "24244").and_return(resp)
|
|
44
|
+
expect(subject).to eq response_utf8
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
38
48
|
context "that fails" do
|
|
39
49
|
let(:resp) { double(code: '500', body: response_body) }
|
|
40
50
|
it "raises an error" do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hydra-derivatives
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.3.
|
|
4
|
+
version: 3.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Justin Coyne
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-08-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -336,7 +336,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
336
336
|
version: '0'
|
|
337
337
|
requirements: []
|
|
338
338
|
rubyforge_project:
|
|
339
|
-
rubygems_version: 2.
|
|
339
|
+
rubygems_version: 2.5.1
|
|
340
340
|
signing_key:
|
|
341
341
|
specification_version: 4
|
|
342
342
|
summary: Derivative generation plugin for hydra
|