hydra-derivatives 3.5.0 → 3.6.0
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/.circleci/config.yml +14 -7
- data/Gemfile +3 -2
- data/README.md +6 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/hydra-derivatives.gemspec +9 -6
- data/lib/hydra/derivatives/config.rb +1 -1
- data/lib/hydra/derivatives/processors/document.rb +4 -1
- data/lib/hydra/derivatives/processors/full_text.rb +5 -3
- data/solr/config/xslt/example.xsl +1 -1
- data/solr/config/xslt/luke.xsl +1 -1
- metadata +132 -92
- data/spec/fixtures/FlashPix.ppt +0 -0
- data/spec/fixtures/adobe1998.tif +0 -0
- data/spec/fixtures/countdown.avi +0 -0
- data/spec/fixtures/jpeg2k_config.yml +0 -20
- data/spec/fixtures/piano_note.wav +0 -0
- data/spec/fixtures/sample.rtf +0 -68
- data/spec/fixtures/test.dng +0 -0
- data/spec/fixtures/test.doc +0 -0
- data/spec/fixtures/test.docx +0 -0
- data/spec/fixtures/test.pdf +0 -0
- data/spec/fixtures/test.pptx +0 -0
- data/spec/fixtures/test.tif +0 -0
- data/spec/fixtures/test.xls +0 -0
- data/spec/fixtures/test.xlsx +0 -0
- data/spec/fixtures/world.png +0 -0
- data/spec/processors/active_encode_spec.rb +0 -132
- data/spec/processors/document_spec.rb +0 -41
- data/spec/processors/full_text_spec.rb +0 -127
- data/spec/processors/image_spec.rb +0 -124
- data/spec/processors/jpeg2k_spec.rb +0 -82
- data/spec/processors/processor_spec.rb +0 -53
- data/spec/processors/shell_based_processor_spec.rb +0 -28
- data/spec/processors/video_spec.rb +0 -59
- data/spec/runners/active_encode_derivatives_spec.rb +0 -38
- data/spec/runners/runner_spec.rb +0 -9
- data/spec/services/audio_derivatives_spec.rb +0 -78
- data/spec/services/persist_basic_contained_output_file_service_spec.rb +0 -42
- data/spec/services/persist_external_file_output_file_service_spec.rb +0 -26
- data/spec/services/persist_output_file_service_spec.rb +0 -47
- data/spec/services/remote_source_file_spec.rb +0 -33
- data/spec/services/retrieve_source_file_service_spec.rb +0 -60
- data/spec/services/tempfile_service_spec.rb +0 -54
- data/spec/spec_helper.rb +0 -40
- data/spec/units/audio_encoder_spec.rb +0 -34
- data/spec/units/config_spec.rb +0 -50
- data/spec/units/derivatives_spec.rb +0 -70
- data/spec/units/io_decorator_spec.rb +0 -45
- data/spec/units/logger_spec.rb +0 -27
- data/spec/units/transcoding_spec.rb +0 -354
data/spec/fixtures/FlashPix.ppt
DELETED
Binary file
|
data/spec/fixtures/adobe1998.tif
DELETED
Binary file
|
data/spec/fixtures/countdown.avi
DELETED
Binary file
|
@@ -1,20 +0,0 @@
|
|
1
|
-
defaults: &defaults
|
2
|
-
jp2_recipes:
|
3
|
-
# note that these aren't real recipes, just enough to test configuration options
|
4
|
-
:myrecipe_color: >
|
5
|
-
-rate 2.4
|
6
|
-
-jp2_space sRGB
|
7
|
-
Stiles=\{1024,1024\}
|
8
|
-
:myrecipe_grey: >
|
9
|
-
-rate 2.4
|
10
|
-
-jp2_space sLUM
|
11
|
-
Stiles=\{1024,1024\}
|
12
|
-
|
13
|
-
development:
|
14
|
-
<<: *defaults
|
15
|
-
|
16
|
-
test:
|
17
|
-
<<: *defaults
|
18
|
-
|
19
|
-
production:
|
20
|
-
<<: *defaults
|
Binary file
|
data/spec/fixtures/sample.rtf
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
|
2
|
-
{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f10\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}
|
3
|
-
{\f121\froman\fcharset238\fprq2 Times New Roman CE;}{\f122\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f124\froman\fcharset161\fprq2 Times New Roman Greek;}{\f125\froman\fcharset162\fprq2 Times New Roman Tur;}
|
4
|
-
{\f126\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f127\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f128\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f129\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
|
5
|
-
{\f131\fswiss\fcharset238\fprq2 Arial CE;}{\f132\fswiss\fcharset204\fprq2 Arial Cyr;}{\f134\fswiss\fcharset161\fprq2 Arial Greek;}{\f135\fswiss\fcharset162\fprq2 Arial Tur;}{\f136\fswiss\fcharset177\fprq2 Arial (Hebrew);}
|
6
|
-
{\f137\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f138\fswiss\fcharset186\fprq2 Arial Baltic;}{\f139\fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f141\fmodern\fcharset238\fprq1 Courier New CE;}{\f142\fmodern\fcharset204\fprq1 Courier New Cyr;}
|
7
|
-
{\f144\fmodern\fcharset161\fprq1 Courier New Greek;}{\f145\fmodern\fcharset162\fprq1 Courier New Tur;}{\f146\fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f147\fmodern\fcharset178\fprq1 Courier New (Arabic);}
|
8
|
-
{\f148\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f149\fmodern\fcharset163\fprq1 Courier New (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;
|
9
|
-
\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{
|
10
|
-
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0
|
11
|
-
\b\f1\fs32\lang1033\langfe1033\kerning32\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \styrsid2294299 heading 1;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\*
|
12
|
-
\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
|
13
|
-
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{\*\ts15\tsrowd\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10
|
14
|
-
\trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
|
15
|
-
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \sbasedon11 \snext15 \styrsid2294299 Table Grid;}{
|
16
|
-
\s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext16 \ssemihidden \styrsid1792631 footnote text;}{\*\cs17 \additive \super
|
17
|
-
\sbasedon10 \ssemihidden \styrsid1792631 footnote reference;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\listtable{\list\listtemplateid-767292450\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360
|
18
|
-
\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext
|
19
|
-
\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693
|
20
|
-
\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers
|
21
|
-
;}\f3\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li3600
|
22
|
-
\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }
|
23
|
-
{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698689\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23
|
24
|
-
\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698691\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
|
25
|
-
\levelfollow0\levelstartat1\levelspace360\levelindent0{\leveltext\leveltemplateid67698693\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid687222349}}{\*\listoverridetable{\listoverride\listid687222349
|
26
|
-
\listoverridecount0\ls1}}{\*\rsidtbl \rsid1792631\rsid2294299}{\*\generator Microsoft Word 11.0.6113;}{\info{\title This is a test RTF}{\author Nate}{\operator Nate}{\version2}}\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1800\dgvorigin1440
|
27
|
-
\dghshow1\dgvshow1\jexpand\viewkind1\viewscale80\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct
|
28
|
-
\asianbrkrule\rsidroot2294299\newtblstyruls\nogrowautofit \fet0{\*\ftnsep \pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1792631 \chftnsep
|
29
|
-
\par }}{\*\ftnsepc \pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1792631 \chftnsepc
|
30
|
-
\par }}{\*\aftnsep \pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1792631 \chftnsep
|
31
|
-
\par }}{\*\aftnsepc \pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid1792631 \chftnsepc
|
32
|
-
\par }}\sectd \linex0\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}
|
33
|
-
{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang
|
34
|
-
{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain
|
35
|
-
\s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid2294299 \b\f1\fs32\lang1033\langfe1033\kerning32\cgrid\langnp1033\langfenp1033 {\insrsid2294299 This is a test RTF
|
36
|
-
\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2294299 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid2294299 Hi! I\rquote m a test file. This is some }{\b\insrsid2294299 bold}{
|
37
|
-
\insrsid2294299 text, and some }{\i\insrsid2294299 italic}{\insrsid2294299 text, as well as some }{\ul\insrsid2294299 underline}{\insrsid2294299 text. And a bit of }{\v\insrsid2294299\charrsid2294299 hidden}{\insrsid2294299 text. So we\rquote
|
38
|
-
re going to end this paragraph here and go on to a nice little list:
|
39
|
-
\par
|
40
|
-
\par {\listtext\pard\plain\f3\insrsid2294299 \loch\af3\dbch\af0\hich\f3 \'b7\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin720\itap0\pararsid2294299 {\insrsid2294299 Item 1
|
41
|
-
\par {\listtext\pard\plain\f3\insrsid2294299 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Item 2
|
42
|
-
\par {\listtext\pard\plain\f3\insrsid2294299 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Item 3
|
43
|
-
\par {\listtext\pard\plain\f3\insrsid2294299 \loch\af3\dbch\af0\hich\f3 \'b7\tab}Item 4
|
44
|
-
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2294299 {\insrsid2294299
|
45
|
-
\par And now comes a fun table:
|
46
|
-
\par
|
47
|
-
\par }\trowd \irow0\irowband0\ts15\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
|
48
|
-
\trftsWidth1\trftsWidthB3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tbllkhdrrows\tbllklastrow\tbllkhdrcols\tbllklastcol \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
|
49
|
-
\cltxlrtb\clftsWidth3\clwWidth2952\clshdrawnil \cellx2844\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2952\clshdrawnil \cellx5796\clvertalt\clbrdrt\brdrs\brdrw10
|
50
|
-
\clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2952\clshdrawnil \cellx8748\pard\plain \ql \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\adjustright\rin0\lin0\pararsid2294299\yts15
|
51
|
-
\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid2294299 Cell 1\cell Cell 2
|
52
|
-
\par More in cell 2\cell Cell 3\cell }\pard\plain \ql \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid2294299 \trowd \irow0\irowband0\ts15\trgaph108\trleft-108\trbrdrt
|
53
|
-
\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10
|
54
|
-
\trftsWidth1\trftsWidthB3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tbllkhdrrows\tbllklastrow\tbllkhdrcols\tbllklastcol \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10
|
55
|
-
\cltxlrtb\clftsWidth3\clwWidth2952\clshdrawnil \cellx2844\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2952\clshdrawnil \cellx5796\clvertalt\clbrdrt\brdrs\brdrw10
|
56
|
-
\clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2952\clshdrawnil \cellx8748\row }\pard\plain \ql \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\adjustright\rin0\lin0\pararsid2294299\yts15
|
57
|
-
\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid2294299 Next row\cell Next row \cell Next row\cell }\pard\plain \ql \li0\ri0\widctlpar\intbl\aspalpha\aspnum\faauto\adjustright\rin0\lin0
|
58
|
-
\fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid2294299 \trowd \irow1\irowband1\lastrow \ts15\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv
|
59
|
-
\brdrs\brdrw10 \trftsWidth1\trftsWidthB3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tbllkhdrrows\tbllklastrow\tbllkhdrcols\tbllklastcol \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr
|
60
|
-
\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2952\clshdrawnil \cellx2844\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2952\clshdrawnil \cellx5796\clvertalt\clbrdrt
|
61
|
-
\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb\clftsWidth3\clwWidth2952\clshdrawnil \cellx8748\row }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid2294299 {
|
62
|
-
\insrsid2294299
|
63
|
-
\par A page break:
|
64
|
-
\par \page And here we\rquote re on the next page.}{\insrsid1792631 }{\insrsid2294299
|
65
|
-
\par }{\insrsid1792631 This para has a }{\cs17\super\insrsid1792631 \chftn {\footnote \pard\plain \s16\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\cs17\super\insrsid1792631
|
66
|
-
\chftn }{\insrsid1792631 This is the actual content of the footnote.}}}{\insrsid1792631 footnote.
|
67
|
-
\par And here\rquote s yet another paragraph. }{\insrsid1792631\charrsid2294299
|
68
|
-
\par }}
|
data/spec/fixtures/test.dng
DELETED
Binary file
|
data/spec/fixtures/test.doc
DELETED
Binary file
|
data/spec/fixtures/test.docx
DELETED
Binary file
|
data/spec/fixtures/test.pdf
DELETED
Binary file
|
data/spec/fixtures/test.pptx
DELETED
Binary file
|
data/spec/fixtures/test.tif
DELETED
Binary file
|
data/spec/fixtures/test.xls
DELETED
Binary file
|
data/spec/fixtures/test.xlsx
DELETED
Binary file
|
data/spec/fixtures/world.png
DELETED
Binary file
|
@@ -1,132 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Hydra::Derivatives::Processors::ActiveEncode do
|
4
|
-
let(:file_path) { File.join(fixture_path, 'videoshort.mp4') }
|
5
|
-
let(:directives) { { url: '12345/derivative' } }
|
6
|
-
let(:output_file_service) { Hydra::Derivatives::PersistExternalFileOutputFileService }
|
7
|
-
let(:options) { { output_file_service: output_file_service } }
|
8
|
-
let(:processor) { described_class.new(file_path, directives, options) }
|
9
|
-
|
10
|
-
describe '#process' do
|
11
|
-
subject { processor.process }
|
12
|
-
|
13
|
-
# Mock out the actual encoding, just pretend that the
|
14
|
-
# encode finished and returned a certain status.
|
15
|
-
let(:failed_status) { false }
|
16
|
-
let(:cancelled_status) { false }
|
17
|
-
let(:completed_status) { false }
|
18
|
-
let(:state) { :completed }
|
19
|
-
let(:errors) { [] }
|
20
|
-
let(:external_url) { 'http://www.example.com/external/content' }
|
21
|
-
let(:output) { [{ url: external_url }] }
|
22
|
-
let(:encode_job_double) do
|
23
|
-
enc = instance_double('encode_job',
|
24
|
-
state: state,
|
25
|
-
errors: errors,
|
26
|
-
output: output,
|
27
|
-
running?: false,
|
28
|
-
completed?: completed_status,
|
29
|
-
failed?: failed_status,
|
30
|
-
cancelled?: cancelled_status)
|
31
|
-
allow(enc).to receive(:reload).and_return(enc)
|
32
|
-
enc
|
33
|
-
end
|
34
|
-
|
35
|
-
context 'with a custom encode class' do
|
36
|
-
before do
|
37
|
-
class TestEncode < ::ActiveEncode::Base; end
|
38
|
-
|
39
|
-
# For this spec we don't care what happens with output,
|
40
|
-
# so stub it out to speed up the spec.
|
41
|
-
allow(output_file_service).to receive(:call)
|
42
|
-
end
|
43
|
-
|
44
|
-
after { Object.send(:remove_const, :TestEncode) }
|
45
|
-
|
46
|
-
let(:completed_status) { true }
|
47
|
-
let(:state) { :completed }
|
48
|
-
let(:options) do
|
49
|
-
{
|
50
|
-
encode_class: TestEncode,
|
51
|
-
output_file_service: output_file_service
|
52
|
-
}
|
53
|
-
end
|
54
|
-
|
55
|
-
it 'uses the configured encode class' do
|
56
|
-
expect(TestEncode).to receive(:create).and_return(encode_job_double)
|
57
|
-
subject
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
context 'when the encoding failed' do
|
62
|
-
let(:state) { :failed }
|
63
|
-
let(:failed_status) { true }
|
64
|
-
let(:errors) { ['error 1', 'error 2'] }
|
65
|
-
|
66
|
-
before do
|
67
|
-
# Don't really encode the file during specs
|
68
|
-
allow(::ActiveEncode::Base).to receive(:create).and_return(encode_job_double)
|
69
|
-
end
|
70
|
-
|
71
|
-
it 'raises an exception' do
|
72
|
-
expect { subject }.to raise_error(Hydra::Derivatives::Processors::ActiveEncodeError, "ActiveEncode status was \"failed\" for #{file_path}: error 1 ; error 2")
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
context 'when the encoding was cancelled' do
|
77
|
-
let(:state) { :cancelled }
|
78
|
-
let(:cancelled_status) { true }
|
79
|
-
|
80
|
-
before do
|
81
|
-
# Don't really encode the file during specs
|
82
|
-
allow(::ActiveEncode::Base).to receive(:create).and_return(encode_job_double)
|
83
|
-
end
|
84
|
-
|
85
|
-
it 'raises an exception' do
|
86
|
-
expect { subject }.to raise_error(Hydra::Derivatives::Processors::ActiveEncodeError, "ActiveEncode status was \"cancelled\" for #{file_path}")
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
context 'when the timeout is set' do
|
91
|
-
before do
|
92
|
-
processor.timeout = 0.01
|
93
|
-
allow(processor).to receive(:wait_for_encode_job) { sleep 0.1 }
|
94
|
-
end
|
95
|
-
|
96
|
-
it 'raises a timeout exception' do
|
97
|
-
msg = "Unable to process ActiveEncode derivative: The command took longer than 0.01 seconds to execute. Encoding will be cancelled."
|
98
|
-
expect { processor.process }.to raise_error Hydra::Derivatives::TimeoutError, msg
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
context 'when the timeout is not set' do
|
103
|
-
before do
|
104
|
-
processor.timeout = nil
|
105
|
-
# Don't really encode the file during specs
|
106
|
-
allow(::ActiveEncode::Base).to receive(:create).and_return(encode_job_double)
|
107
|
-
end
|
108
|
-
|
109
|
-
it 'processes the encoding without a timeout' do
|
110
|
-
expect(processor).not_to receive(:wait_for_encode_job_with_timeout)
|
111
|
-
expect(processor).to receive(:wait_for_encode_job).once
|
112
|
-
processor.process
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
context 'when error occurs during timeout cleanup' do
|
117
|
-
let(:error) { StandardError.new('some error message') }
|
118
|
-
|
119
|
-
before do
|
120
|
-
processor.timeout = 0.01
|
121
|
-
allow(processor).to receive(:wait_for_encode_job) { sleep 0.1 }
|
122
|
-
allow(::ActiveEncode::Base).to receive(:create).and_return(encode_job_double)
|
123
|
-
allow(encode_job_double).to receive(:cancel!).and_raise(error)
|
124
|
-
end
|
125
|
-
|
126
|
-
it 'doesnt lose the timeout error, but adds the new error message' do
|
127
|
-
msg = "Unable to process ActiveEncode derivative: The command took longer than 0.01 seconds to execute. Encoding will be cancelled. An error occurred while trying to cancel encoding: some error message"
|
128
|
-
expect { processor.process }.to raise_error Hydra::Derivatives::TimeoutError, msg
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Hydra::Derivatives::Processors::Document do
|
4
|
-
subject { described_class.new(source_path, directives) }
|
5
|
-
|
6
|
-
let(:source_path) { File.join(fixture_path, "test.doc") }
|
7
|
-
let(:output_service) { Hydra::Derivatives::PersistBasicContainedOutputFileService }
|
8
|
-
|
9
|
-
before { allow(subject).to receive(:converted_file).and_return(converted_file) }
|
10
|
-
|
11
|
-
describe "#encode_file" do
|
12
|
-
context "when converting to jpg" do
|
13
|
-
let(:directives) { { format: "jpg" } }
|
14
|
-
let(:converted_file) { "path/to/pdf/created/from/original" }
|
15
|
-
let(:mock_processor) { double }
|
16
|
-
|
17
|
-
before do
|
18
|
-
allow(Hydra::Derivatives::Processors::Image).to receive(:new).with(converted_file, directives).and_return(mock_processor)
|
19
|
-
end
|
20
|
-
|
21
|
-
it "creates a thumbnail of the document using a pdf created from the original" do
|
22
|
-
expect(mock_processor).to receive(:process)
|
23
|
-
expect(File).to receive(:unlink).with(converted_file)
|
24
|
-
subject.encode_file("jpg")
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
context "when converting to another format" do
|
29
|
-
let(:directives) { { format: "png" } }
|
30
|
-
let(:converted_file) { "path/to/converted.png" }
|
31
|
-
let(:mock_content) { "mocked png content" }
|
32
|
-
|
33
|
-
before { allow(File).to receive(:read).with(converted_file).and_return(mock_content) }
|
34
|
-
it "creates a thumbnail of the document" do
|
35
|
-
expect(output_service).to receive(:call).with(mock_content, directives)
|
36
|
-
expect(File).to receive(:unlink).with(converted_file)
|
37
|
-
subject.encode_file("png")
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,127 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Hydra::Derivatives::Processors::FullText do
|
4
|
-
let(:file_path) { File.join(fixture_path, 'test.docx') }
|
5
|
-
let(:directives) { { format: 'txt', url: RDF::URI('http://localhost:8983/fedora/rest/dev/1234/ogg') } }
|
6
|
-
let(:processor) { described_class.new(file_path, directives) }
|
7
|
-
|
8
|
-
describe "#process" do
|
9
|
-
it 'extracts fulltext and stores the results' do
|
10
|
-
expect(processor.output_file_service).to receive(:call) do |first, second|
|
11
|
-
expect(first).to match(/Project Charter for E-Content Delivery Platform Review/)
|
12
|
-
expect(second).to eq directives
|
13
|
-
end
|
14
|
-
processor.process
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe "fetch" do
|
19
|
-
subject { processor.send(:fetch) }
|
20
|
-
|
21
|
-
let(:response_body) { 'returned by Solr' }
|
22
|
-
let(:uri) { URI('https://example.com:99/solr/update') }
|
23
|
-
let(:req) do
|
24
|
-
Net::HTTP::Post.new(
|
25
|
-
'/solr/update',
|
26
|
-
"Content-Type" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Content-Length" => "24244"
|
27
|
-
)
|
28
|
-
end
|
29
|
-
|
30
|
-
before do
|
31
|
-
allow(processor).to receive(:uri).and_return(uri)
|
32
|
-
end
|
33
|
-
|
34
|
-
context "when that is successful" do
|
35
|
-
let(:resp) { double(code: '200', type_params: {}, body: response_body) }
|
36
|
-
|
37
|
-
it "calls the extraction service" do
|
38
|
-
expect(processor).to receive(:check_for_ssl)
|
39
|
-
expect(Net::HTTP).to receive(:start).with('example.com', 99).and_yield(req)
|
40
|
-
expect(Net::HTTP::Post).to receive(:new).with('/solr/update', "Content-Type" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Content-Length" => "24244").and_return(req)
|
41
|
-
expect(req).to receive(:request).and_return(resp)
|
42
|
-
expect(subject).to eq response_body
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
context "when that is successful with UTF-8 content" do
|
47
|
-
let(:response_utf8) { "returned by “Solr”" }
|
48
|
-
let(:response_ascii) { response_utf8.dup.force_encoding("ASCII-8BIT") }
|
49
|
-
let(:resp) { double(code: '200', type_params: { "charset" => "UTF-8" }, body: response_ascii) }
|
50
|
-
|
51
|
-
it "calls the extraction service" do
|
52
|
-
expect(processor).to receive(:check_for_ssl)
|
53
|
-
expect(Net::HTTP).to receive(:start).with('example.com', 99).and_yield(req)
|
54
|
-
expect(Net::HTTP::Post).to receive(:new).with('/solr/update', "Content-Type" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Content-Length" => "24244").and_return(req)
|
55
|
-
expect(req).to receive(:request).and_return(resp)
|
56
|
-
expect(subject).to eq response_utf8
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
context "when that fails" do
|
61
|
-
let(:resp) { double(code: '500', body: response_body) }
|
62
|
-
|
63
|
-
it "raises an error" do
|
64
|
-
expect(processor).to receive(:check_for_ssl)
|
65
|
-
expect(Net::HTTP).to receive(:start).with('example.com', 99).and_yield(req)
|
66
|
-
expect(Net::HTTP::Post).to receive(:new).with('/solr/update', "Content-Type" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Content-Length" => "24244").and_return(req)
|
67
|
-
expect(req).to receive(:request).and_return(resp)
|
68
|
-
expect { subject }.to raise_error(RuntimeError, %r{^Solr Extract service was unsuccessful. 'https://example\.com:99/solr/update' returned code 500})
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
context "with basic_auth" do
|
73
|
-
let(:resp) { double(code: '200', type_params: {}, body: response_body) }
|
74
|
-
let(:uri) { URI('https://user:password@example.com:99/solr/update') }
|
75
|
-
|
76
|
-
it "calls the extraction service with basic auth" do
|
77
|
-
expect(processor).to receive(:check_for_ssl)
|
78
|
-
expect(Net::HTTP).to receive(:start).with('example.com', 99).and_yield(req)
|
79
|
-
expect(Net::HTTP::Post).to receive(:new).with('/solr/update', "Content-Type" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "Content-Length" => "24244").and_return(req)
|
80
|
-
expect(req).to receive(:basic_auth).with('user', 'password')
|
81
|
-
expect(req).to receive(:request).and_return(resp)
|
82
|
-
expect(subject).to eq response_body
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
context "with no basic_auth credentials" do
|
87
|
-
let(:resp) { double(code: '401', type_params: {}, body: response_body) }
|
88
|
-
let(:uri) { URI('https://user:password@example.com:99/solr/update') }
|
89
|
-
|
90
|
-
it "raises a 401 error" do
|
91
|
-
req.basic_auth(nil, nil)
|
92
|
-
expect(processor).to receive(:check_for_ssl)
|
93
|
-
expect(Net::HTTP).to receive(:start).with('example.com', 99).and_yield(req)
|
94
|
-
expect(req).to receive(:request).and_return(resp)
|
95
|
-
expect { subject }.to raise_error(RuntimeError, %r{^Solr Extract service was unsuccessful. 'https://user:password@example.com:99/solr/update' returned code 401})
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
describe "uri" do
|
101
|
-
subject { processor.send(:uri) }
|
102
|
-
|
103
|
-
let(:root) { URI('https://example.com/solr/myCollection/') }
|
104
|
-
|
105
|
-
before do
|
106
|
-
allow(ActiveFedora::SolrService.instance.conn).to receive(:uri).and_return(root)
|
107
|
-
end
|
108
|
-
|
109
|
-
it "points at the extraction service" do
|
110
|
-
expect(subject).to be_kind_of URI
|
111
|
-
expect(subject.to_s).to eq 'https://example.com/solr/myCollection/update/extract?extractOnly=true&wt=json&extractFormat=text'
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
describe "check_for_ssl" do
|
116
|
-
subject { processor.send(:check_for_ssl) }
|
117
|
-
|
118
|
-
it "returns false if uri.scheme is http" do
|
119
|
-
allow(processor).to receive(:uri).and_return(URI('http://example.com:99/solr/update'))
|
120
|
-
expect(subject).to be false
|
121
|
-
end
|
122
|
-
it "returns true if uri.scheme is https" do
|
123
|
-
allow(processor).to receive(:uri).and_return(URI('https://example.com:99/solr/update'))
|
124
|
-
expect(subject).to be true
|
125
|
-
end
|
126
|
-
end
|
127
|
-
end
|
@@ -1,124 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Hydra::Derivatives::Processors::Image do
|
4
|
-
subject { described_class.new(file_name, directives) }
|
5
|
-
|
6
|
-
let(:file_name) { "file_name" }
|
7
|
-
|
8
|
-
context "when arguments are passed as a hash" do
|
9
|
-
before { allow(subject).to receive(:load_image_transformer).and_return(mock_image) }
|
10
|
-
|
11
|
-
context "with a multi-page pdf source file" do
|
12
|
-
let(:first_page) { instance_double("MockPage") }
|
13
|
-
let(:second_page) { instance_double("MockPage") }
|
14
|
-
let(:mock_image) { instance_double("MockImageOfPdf", layers: [first_page, second_page]) }
|
15
|
-
|
16
|
-
before { allow(mock_image).to receive(:type).and_return("PDF") }
|
17
|
-
|
18
|
-
context "when default" do
|
19
|
-
let(:directives) { { label: :thumb, size: "200x300>", format: 'png', quality: 75 } }
|
20
|
-
|
21
|
-
it "uses the first page" do
|
22
|
-
expect(first_page).to receive(:flatten)
|
23
|
-
expect(second_page).not_to receive(:flatten)
|
24
|
-
expect(first_page).to receive(:resize).with("200x300>")
|
25
|
-
expect(second_page).not_to receive(:resize)
|
26
|
-
expect(first_page).to receive(:format).with("png")
|
27
|
-
expect(second_page).not_to receive(:format)
|
28
|
-
expect(first_page).to receive(:quality).with("75")
|
29
|
-
expect(second_page).not_to receive(:quality)
|
30
|
-
expect(subject).to receive(:write_image).with(first_page)
|
31
|
-
subject.process
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
context "when specifying a layer" do
|
36
|
-
let(:directives) { { label: :thumb, size: "200x300>", format: 'png', quality: 75, layer: 1 } }
|
37
|
-
|
38
|
-
it "uses the second page" do
|
39
|
-
expect(second_page).to receive(:flatten)
|
40
|
-
expect(first_page).not_to receive(:flatten)
|
41
|
-
expect(second_page).to receive(:resize).with("200x300>")
|
42
|
-
expect(first_page).not_to receive(:resize)
|
43
|
-
expect(second_page).to receive(:format).with("png")
|
44
|
-
expect(first_page).not_to receive(:format)
|
45
|
-
expect(second_page).to receive(:quality).with("75")
|
46
|
-
expect(first_page).not_to receive(:quality)
|
47
|
-
expect(subject).to receive(:write_image).with(second_page)
|
48
|
-
subject.process
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
context "with an image source file" do
|
54
|
-
before { allow(mock_image).to receive(:type).and_return("JPEG") }
|
55
|
-
|
56
|
-
context "when default" do
|
57
|
-
let(:mock_image) { instance_double("MockImage") }
|
58
|
-
let(:directives) { { label: :thumb, size: "200x300>", format: 'png', quality: 75 } }
|
59
|
-
|
60
|
-
it "uses the image file" do
|
61
|
-
expect(mock_image).not_to receive(:layers)
|
62
|
-
expect(mock_image).to receive(:flatten)
|
63
|
-
expect(mock_image).to receive(:resize).with("200x300>")
|
64
|
-
expect(mock_image).to receive(:format).with("png")
|
65
|
-
expect(mock_image).to receive(:quality).with("75")
|
66
|
-
expect(subject).to receive(:write_image).with(mock_image)
|
67
|
-
subject.process
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
context "when specifying a layer" do
|
72
|
-
let(:first_layer) { instance_double("MockPage") }
|
73
|
-
let(:second_layer) { instance_double("MockPage") }
|
74
|
-
let(:mock_image) { instance_double("MockImage", layers: [first_layer, second_layer]) }
|
75
|
-
let(:directives) { { label: :thumb, size: "200x300>", format: 'png', quality: 75, layer: 1 } }
|
76
|
-
|
77
|
-
it "uses the layer" do
|
78
|
-
expect(second_layer).to receive(:flatten)
|
79
|
-
expect(first_layer).not_to receive(:flatten)
|
80
|
-
expect(second_layer).to receive(:resize).with("200x300>")
|
81
|
-
expect(first_layer).not_to receive(:resize)
|
82
|
-
expect(second_layer).to receive(:format).with("png")
|
83
|
-
expect(first_layer).not_to receive(:format)
|
84
|
-
expect(second_layer).to receive(:quality).with("75")
|
85
|
-
expect(first_layer).not_to receive(:quality)
|
86
|
-
expect(subject).to receive(:write_image).with(second_layer)
|
87
|
-
subject.process
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
describe "#process" do
|
94
|
-
let(:directives) { { size: "100x100>", format: "png" } }
|
95
|
-
|
96
|
-
context "when a timeout is set" do
|
97
|
-
before do
|
98
|
-
subject.timeout = 0.1
|
99
|
-
allow(subject).to receive(:create_resized_image) { sleep 0.2 }
|
100
|
-
end
|
101
|
-
it "raises a timeout exception" do
|
102
|
-
expect { subject.process }.to raise_error Hydra::Derivatives::TimeoutError
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
context "when not set" do
|
107
|
-
before { subject.timeout = nil }
|
108
|
-
it "processes without a timeout" do
|
109
|
-
expect(subject).to receive(:process_with_timeout).never
|
110
|
-
expect(subject).to receive(:create_resized_image).once
|
111
|
-
subject.process
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
context "when running the complete command", requires_imagemagick: true do
|
116
|
-
let(:file_name) { File.join(fixture_path, "test.tif") }
|
117
|
-
|
118
|
-
it "converts the image" do
|
119
|
-
expect(Hydra::Derivatives::PersistBasicContainedOutputFileService).to receive(:call).with(kind_of(StringIO), directives)
|
120
|
-
subject.process
|
121
|
-
end
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|