hydra-derivatives 3.3.1 → 3.3.2

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
  SHA1:
3
- metadata.gz: 3ba5f325949132a7201726c3c2d43a22e38efb84
4
- data.tar.gz: '009267a617253cd3ee3c7cd23a3556b3bbec1e5e'
3
+ metadata.gz: 3cb485ab21d05631d5c5643d6fe6726d2dc82fb3
4
+ data.tar.gz: 2f30a6f276a10e750bd4d1f5acde291d775e5668
5
5
  SHA512:
6
- metadata.gz: 86d072cf269aefc35f7a18925e96a8f3002964ffadbd917e2507e5f4a37b646d39e9f5bdbdd492476a36bbcc659b78c30580394be89d08672585de4bb0eca6ef
7
- data.tar.gz: '089461874c714dd28e60129c65b50a61de16cc3b0ad95d30e3fd2f0ac721816bfb7bdfba1d14c16aff41a4d2547ae9fe3f7b3321036378d68c1763e1f6815aa7'
6
+ metadata.gz: 6b0618b15bb531bbe5d2b476b790b3f26652a8ebab3403a325ff720d2fc16b933de2e8c37e94521eb14e405b1f15ceda036c0ef647808d995e81389fb471a250
7
+ data.tar.gz: 02225a904af793102c24dbd983116640dea8183ce331f0fb40830095d8012466dfe7c5870ca0a6f398956b2bbdaffeaadfa555d1e7a49c8db936caf65e759c6d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.1
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.1
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-06-22 00:00:00.000000000 Z
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.6.12
339
+ rubygems_version: 2.5.1
340
340
  signing_key:
341
341
  specification_version: 4
342
342
  summary: Derivative generation plugin for hydra