hydra-works 0.16.0 → 0.17.0

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: c1d6b6f3987a8df560123eee26e60f231fad1e8a
4
- data.tar.gz: fefe3540d414cf554eea479f2de2249ee0417071
3
+ metadata.gz: 893f499fbbc467f6a4b8dfccc3bccc10a354dcab
4
+ data.tar.gz: '090d506ffcf111d4258beb3092915e6fdf9499fe'
5
5
  SHA512:
6
- metadata.gz: 8eb1fb9eae7a8dd692008ccc0c30c2707f694717e2d0d59e190afce5466557b25a26692e63be6dca281a083d96603d1a66c59d7503d0b3b17bdf35e2c159728f
7
- data.tar.gz: 60c735f5169ae1f41a9b8a33013147961b830d536e4c41fd4f3b28b76709a731d192983966798276ca30ec44612a67b8bcb214f6712ae93251e60ad5fd22fcd4
6
+ metadata.gz: 6e82db5eaff3cebbe7d0f2c83d14879f4ca444cf751c16b09991920e6d10c858374f71f05d5150dbe9bf455377b1cd50da6f5304613bc693672aaf2e9c6ab077
7
+ data.tar.gz: 56b38a831c16854182c52b42e0abee06c8bf814b9c5a00fa1ed9aa931be9d6a460fbccc375cb5292bf199eea9f0a80613304fbf2940eb9254c63b402ce61fd4c
@@ -7,8 +7,6 @@ AllCops:
7
7
  - '**/Rakefile'
8
8
  Exclude:
9
9
  - 'vendor/**/*'
10
- - 'spec/internal/bin/*'
11
- - 'spec/internal/db/schema.rb'
12
10
 
13
11
  Metrics/BlockLength:
14
12
  Exclude:
@@ -66,10 +64,6 @@ RSpec/FilePath:
66
64
  RSpec/InstanceVariable:
67
65
  Enabled: false
68
66
 
69
- RSpec/DescribedClass:
70
- Exclude:
71
- - spec/hydra/works/models/concerns/generic_file/characterization_spec.rb
72
-
73
67
  RSpec/AnyInstance:
74
68
  Exclude:
75
69
  - spec/hydra/works/services/persist_derivatives_spec.rb
@@ -6,8 +6,8 @@ env:
6
6
  global:
7
7
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
8
8
  rvm:
9
- - 2.3.1
10
- - 2.4.0
9
+ - 2.3.4
10
+ - 2.4.1
11
11
  before_script:
12
12
  - jdk_switcher use oraclejdk8
13
13
 
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gem 'slop', '~> 3.6' # For byebug
7
7
 
8
8
  group :development, :test do
9
9
  gem 'rubocop', '~> 0.47.0', require: false
10
- gem 'rubocop-rspec', require: false
10
+ gem 'rubocop-rspec', '~> 1.13.0', require: false
11
11
  gem 'pry' unless ENV['CI']
12
12
  gem 'pry-byebug' unless ENV['CI']
13
13
  end
data/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # Hydra::Works
2
2
 
3
3
  [![Version](https://badge.fury.io/rb/hydra-works.png)](http://badge.fury.io/rb/hydra-works)
4
- [![Build Status](https://travis-ci.org/projecthydra/hydra-works.svg?branch=master)](https://travis-ci.org/projecthydra/hydra-works)
5
- [![Coverage Status](https://coveralls.io/repos/projecthydra/hydra-works/badge.svg?branch=master)](https://coveralls.io/r/projecthydra/hydra-works?branch=master)
6
- [![Code Climate](https://codeclimate.com/github/projecthydra/hydra-works/badges/gpa.svg)](https://codeclimate.com/github/projecthydra/hydra-works)
4
+ [![Build Status](https://travis-ci.org/samvera/hydra-works.svg?branch=master)](https://travis-ci.org/samvera/hydra-works)
5
+ [![Coverage Status](https://coveralls.io/repos/samvera/hydra-works/badge.svg?branch=master)](https://coveralls.io/r/samvera/hydra-works?branch=master)
6
+ [![Code Climate](https://codeclimate.com/github/samvera/hydra-works/badges/gpa.svg)](https://codeclimate.com/github/samvera/hydra-works)
7
7
  [![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE)
8
8
  [![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md)
9
9
  [![API Docs](http://img.shields.io/badge/API-docs-blue.svg)](http://rubydoc.info/gems/hydra-works)
10
10
 
11
- The Hydra::Works gem implements the [PCDM](https://github.com/duraspace/pcdm/wiki) [Works](https://github.com/duraspace/pcdm/blob/master/pcdm-ext/works.rdf) data model using ActiveFedora-based models. In addition to the models, Hydra::Works includes associated behaviors around the broad concept of describable "works" or intellectual entities, the need for which was expressed by a variety of [Hydra community use cases](https://github.com/projecthydra/hydra-works/tree/master/use-cases). The PCDM Works domain model includes the following high-level entities:
11
+ The Hydra::Works gem implements the [PCDM](https://github.com/duraspace/pcdm/wiki) [Works](https://github.com/duraspace/pcdm/blob/master/pcdm-ext/works.rdf) data model using ActiveFedora-based models. In addition to the models, Hydra::Works includes associated behaviors around the broad concept of describable "works" or intellectual entities, the need for which was expressed by a variety of [Hydra community use cases](https://github.com/samvera/hydra-works/tree/master/use-cases). The PCDM Works domain model includes the following high-level entities:
12
12
 
13
13
  * **Collection**: a *pcdm:Collection* that indirectly contains zero or more **Works** and zero or more **Collection**s
14
14
  * **Work**: a *pcdm:Object* that holds zero or more **FileSets** and zero or more **Works**
@@ -23,7 +23,7 @@ Behaviors included in the model include:
23
23
  * Virus checking of original files
24
24
  * Full-text extraction from original files
25
25
 
26
- Check out the [Hydra::Derivatives README](https://github.com/projecthydra/hydra-derivatives#dependencies) for additional dependencies.
26
+ Check out the [Hydra::Derivatives README](https://github.com/samvera/hydra-derivatives#dependencies) for additional dependencies.
27
27
 
28
28
  ## Installation
29
29
 
@@ -88,7 +88,7 @@ end
88
88
 
89
89
  ## Access controls
90
90
 
91
- We are using [Web ACL](http://www.w3.org/wiki/WebAccessControl) as implemented by [hydra-access-controls](https://github.com/projecthydra/hydra-head/tree/master/hydra-access-controls).
91
+ We are using [Web ACL](http://www.w3.org/wiki/WebAccessControl) as implemented by [hydra-access-controls](https://github.com/samvera/hydra-head/tree/master/hydra-access-controls).
92
92
 
93
93
  ## How to contribute
94
94
 
@@ -108,21 +108,22 @@ rake
108
108
 
109
109
  ### Testing manually
110
110
 
111
- If you want to run the tests manually, follow these instructions:
111
+ If you want to run the tests manually, first run solr and FCRepo. To start solr:
112
112
 
113
113
  ```bash
114
- solr_wrapper -d solr/config/
114
+ solr_wrapper -v -d solr/config/ -n hydra-test -p 8985
115
115
  ```
116
116
 
117
117
  To start FCRepo, open another shell and run:
118
118
 
119
119
  ```bash
120
- fcrepo_wrapper -p 8984
120
+ fcrepo_wrapper -v -p 8986 --no-jms
121
121
  ```
122
+ Note you won't find these ports mentioned in this codebase, as testing behavior is inherited from ActiveFedora.
122
123
 
123
124
  Now you’re ready to run the tests. In the directory where hydra-works
124
125
  is installed, run:
125
126
 
126
127
  ```bash
127
- rake spec
128
+ rake works:spec
128
129
  ```
@@ -2,6 +2,7 @@
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'hydra/works/version'
5
+ DO_NOT_SHIP = ['spec/fixtures/eicar.txt']
5
6
 
6
7
  Gem::Specification.new do |spec|
7
8
  spec.name = 'hydra-works'
@@ -13,7 +14,7 @@ Gem::Specification.new do |spec|
13
14
  spec.homepage = 'https://github.com/projecthydra-labs/hydra-works'
14
15
  spec.license = 'APACHE2'
15
16
 
16
- spec.files = `git ls-files -z`.split("\x0")
17
+ spec.files = `git ls-files -z`.split("\x0") - DO_NOT_SHIP
17
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
20
  spec.require_paths = ['lib']
@@ -146,6 +146,20 @@ module Hydra::Works::Characterization
146
146
  t.frame_rate(proxy: [:metadata, :video, :frame_rate])
147
147
  end
148
148
 
149
+ # Cleanup phase; ugly name to avoid collisions.
150
+ # The send construct here is required to fix up values because the setters
151
+ # are not defined, but rather applied with method_missing.
152
+ def __cleanup__
153
+ # Sometimes, FITS reports the mimetype attribute as a comma-separated string.
154
+ # All terms are arrays and, in this case, there is only one element, so scan the first.
155
+ if file_mime_type.present? && file_mime_type.first.include?(',')
156
+ send("file_mime_type=", [file_mime_type.first.split(',').first])
157
+ end
158
+
159
+ # Add any other scrubbers here; don't return any particular value
160
+ nil
161
+ end
162
+
149
163
  def self.xml_template
150
164
  builder = Nokogiri::XML::Builder.new do |xml|
151
165
  xml.fits(xmlns: 'http://hul.harvard.edu/ois/xml/ns/fits/fits_output',
@@ -62,6 +62,7 @@ module Hydra::Works
62
62
  def parse_metadata(metadata)
63
63
  omdoc = parser_class.new
64
64
  omdoc.ng_xml = Nokogiri::XML(metadata) if metadata.present?
65
+ omdoc.__cleanup__ if omdoc.respond_to? :__cleanup__
65
66
  characterization_terms(omdoc)
66
67
  end
67
68
 
@@ -101,7 +102,10 @@ module Hydra::Works
101
102
  end
102
103
 
103
104
  def append_property_value(property, value)
105
+ # We don't want multiple mime_types; this overwrites each time to accept last value
104
106
  value = object.send(property) + [value] unless property == :mime_type
107
+ # We don't want multiple heights / widths, pick the max
108
+ value = value.map(&:to_i).max.to_s if property == :height || property == :width
105
109
  object.send("#{property}=", value)
106
110
  end
107
111
  end
@@ -1,7 +1,7 @@
1
1
  module Hydra::Works
2
2
  class DetermineOriginalName
3
3
  # Determines the original name for a given file
4
- # @param [IO, File, Rack::Multipart::UploadedFile, #read] file
4
+ # @param [IO, File, Rack::Multipart::UploadedFile] file
5
5
  # @return [String]
6
6
  def self.call(file)
7
7
  return file.original_name if file.respond_to?(:original_name)
@@ -1,5 +1,5 @@
1
1
  module Hydra
2
2
  module Works
3
- VERSION = '0.16.0'.freeze
3
+ VERSION = '0.17.0'.freeze
4
4
  end
5
5
  end
@@ -0,0 +1,78 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <fits xmlns="http://hul.harvard.edu/ois/xml/ns/fits/fits_output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/fits/fits_output http://hul
3
+ .harvard.edu/ois/xml/xsd/fits/fits_output.xsd" version="0.8.5" timestamp="6/20/17 11:20 AM">
4
+ <identification>
5
+ <identity format="Tagged Image File Format" mimetype="image/tiff" toolname="FITS" toolversion="0.8.5">
6
+ <tool toolname="Jhove" toolversion="1.5" />
7
+ <tool toolname="file utility" toolversion="5.14" />
8
+ <tool toolname="Exiftool" toolversion="9.13" />
9
+ <tool toolname="ffident" toolversion="0.2" />
10
+ <tool toolname="Tika" toolversion="1.3" />
11
+ <version toolname="Jhove" toolversion="1.5">6.0</version>
12
+ </identity>
13
+ </identification>
14
+ <fileinfo>
15
+ <size toolname="Jhove" toolversion="1.5">11082294</size>
16
+ <creatingApplicationName toolname="Jhove" toolversion="1.5">Capture One 8 Macintosh</creatingApplicationName>
17
+ <lastmodified toolname="Exiftool" toolversion="9.13" status="CONFLICT">2017:06:19 14:26:24-04:00</lastmodified>
18
+ <lastmodified toolname="Tika" toolversion="1.3" status="CONFLICT">2016-08-22T11:40:49</lastmodified>
19
+ <created toolname="Exiftool" toolversion="9.13" status="SINGLE_RESULT">2016:08:22 11:40:49</created>
20
+ <filepath toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">/home/ubuntu/2012-002_928.tif</filepath>
21
+ <filename toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">2012-002_928.tif</filename>
22
+ <md5checksum toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">b8344bf2f88bd421986d9ac988578e28</md5checksum>
23
+ <fslastmodified toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">1497896784000</fslastmodified>
24
+ </fileinfo>
25
+ <filestatus>
26
+ <well-formed toolname="Jhove" toolversion="1.5" status="SINGLE_RESULT">true</well-formed>
27
+ <valid toolname="Jhove" toolversion="1.5" status="SINGLE_RESULT">true</valid>
28
+ </filestatus>
29
+ <metadata>
30
+ <image>
31
+ <byteOrder toolname="Jhove" toolversion="1.5" status="SINGLE_RESULT">little endian</byteOrder>
32
+ <byteOrder toolname="Jhove" toolversion="1.5" status="SINGLE_RESULT">little endian</byteOrder>
33
+ <compressionScheme toolname="Jhove" toolversion="1.5">Uncompressed</compressionScheme>
34
+ <imageWidth toolname="Tika" toolversion="1.3" status="CONFLICT">160</imageWidth>
35
+ <imageWidth toolname="Jhove" toolversion="1.5" status="CONFLICT">2226</imageWidth>
36
+ <imageHeight toolname="Jhove" toolversion="1.5" status="CONFLICT">1650</imageHeight>
37
+ <imageHeight toolname="Tika" toolversion="1.3" status="CONFLICT">119</imageHeight>
38
+ <colorSpace toolname="Jhove" toolversion="1.5">RGB</colorSpace>
39
+ <referenceBlackWhite toolname="Jhove" toolversion="1.5" status="SINGLE_RESULT">0.0 255.0 0.0 255.0 0.0 255.0 0.0 255.0 0.0 255.0 0.0 255.0</referenceBlackWhite>
40
+ <iccProfileName toolname="Exiftool" toolversion="9.13" status="SINGLE_RESULT">Adobe RGB (1998)</iccProfileName>
41
+ <orientation toolname="Jhove" toolversion="1.5">normal*</orientation>
42
+ <samplingFrequencyUnit toolname="Jhove" toolversion="1.5">in.</samplingFrequencyUnit>
43
+ <xSamplingFrequency toolname="Jhove" toolversion="1.5">300</xSamplingFrequency>
44
+ <ySamplingFrequency toolname="Jhove" toolversion="1.5">300</ySamplingFrequency>
45
+ <bitsPerSample toolname="Jhove" toolversion="1.5">8 8 8</bitsPerSample>
46
+ <bitsPerSample toolname="Jhove" toolversion="1.5" status="SINGLE_RESULT">8 8 8</bitsPerSample>
47
+ <samplesPerPixel toolname="Jhove" toolversion="1.5" status="CONFLICT">3 3</samplesPerPixel>
48
+ <samplesPerPixel toolname="Exiftool" toolversion="9.13" status="CONFLICT">3</samplesPerPixel>
49
+ <scanningSoftwareName toolname="Jhove" toolversion="1.5">Capture One 8 Macintosh</scanningSoftwareName>
50
+ <digitalCameraModelName toolname="Exiftool" toolversion="9.13" status="SINGLE_RESULT">IQ3 80MP</digitalCameraModelName>
51
+ <exposureTime toolname="Jhove" toolversion="1.5" status="CONFLICT">0.017</exposureTime>
52
+ <exposureTime toolname="Exiftool" toolversion="9.13" status="CONFLICT">1/60</exposureTime>
53
+ <isoSpeedRating toolname="Jhove" toolversion="1.5">50</isoSpeedRating>
54
+ <lightSource toolname="Jhove" toolversion="1.5" status="CONFLICT">other</lightSource>
55
+ <lightSource toolname="Exiftool" toolversion="9.13" status="CONFLICT">other light source</lightSource>
56
+ <iccProfileVersion toolname="Exiftool" toolversion="9.13" status="SINGLE_RESULT">2.1.0</iccProfileVersion>
57
+ <captureDevice toolname="Exiftool" toolversion="9.13" status="SINGLE_RESULT">digital still camera</captureDevice>
58
+ <digitalCameraManufacturer toolname="Exiftool" toolversion="9.13" status="SINGLE_RESULT">Phase One</digitalCameraManufacturer>
59
+ <exposureProgram toolname="Exiftool" toolversion="9.13" status="SINGLE_RESULT">Manual</exposureProgram>
60
+ <exifVersion toolname="Exiftool" toolversion="9.13" status="SINGLE_RESULT">0220</exifVersion>
61
+ <shutterSpeedValue toolname="Exiftool" toolversion="9.13" status="SINGLE_RESULT">1/60</shutterSpeedValue>
62
+ <sensingMethod toolname="Exiftool" toolversion="9.13" status="SINGLE_RESULT">One-chip color area sensor</sensingMethod>
63
+ </image>
64
+ </metadata>
65
+ <statistics fitsExecutionTime="1523">
66
+ <tool toolname="OIS Audio Information" toolversion="0.1" status="did not run" />
67
+ <tool toolname="ADL Tool" toolversion="0.1" status="did not run" />
68
+ <tool toolname="Jhove" toolversion="1.5" executionTime="1220" />
69
+ <tool toolname="file utility" toolversion="5.14" executionTime="964" />
70
+ <tool toolname="Exiftool" toolversion="9.13" executionTime="1110" />
71
+ <tool toolname="NLNZ Metadata Extractor" toolversion="3.4GA" status="did not run" />
72
+ <tool toolname="OIS File Information" toolversion="0.2" executionTime="225" />
73
+ <tool toolname="OIS XML Metadata" toolversion="0.2" status="did not run" />
74
+ <tool toolname="ffident" toolversion="0.2" executionTime="695" />
75
+ <tool toolname="Tika" toolversion="1.3" executionTime="1371" />
76
+ </statistics>
77
+ </fits>
78
+
@@ -0,0 +1,35 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- The netCDF file analzyed to produce this output was madis-raob.nc from https://www.unidata.ucar.edu/software/netcdf/examples/files.html -->
3
+ <fits xmlns="http://hul.harvard.edu/ois/xml/ns/fits/fits_output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/fits/fits_output http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd" version="1.2.0" timestamp="2/7/18 10:03 PM">
4
+ <identification status="SINGLE_RESULT">
5
+ <identity format="netCDF-3 Classic" mimetype="application/netcdf, application/x-netcdf" toolname="FITS" toolversion="1.2.0">
6
+ <tool toolname="Droid" toolversion="6.3" />
7
+ <externalIdentifier toolname="Droid" toolversion="6.3" type="puid">fmt/282</externalIdentifier>
8
+ </identity>
9
+ </identification>
10
+ <fileinfo>
11
+ <filepath toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">/madis-raob.nc</filepath>
12
+ <filename toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">madis-raob.nc</filename>
13
+ <size toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">150612</size>
14
+ <md5checksum toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">47b926e988723c65f0cdaf4117f4ef4d</md5checksum>
15
+ <fslastmodified toolname="OIS File Information" toolversion="0.2" status="SINGLE_RESULT">1347484346000</fslastmodified>
16
+ </fileinfo>
17
+ <filestatus />
18
+ <metadata />
19
+ <statistics fitsExecutionTime="1000">
20
+ <tool toolname="MediaInfo" toolversion="0.7.75" status="did not run" />
21
+ <tool toolname="OIS Audio Information" toolversion="0.1" status="did not run" />
22
+ <tool toolname="ADL Tool" toolversion="0.1" status="did not run" />
23
+ <tool toolname="VTT Tool" toolversion="0.1" status="did not run" />
24
+ <tool toolname="Droid" toolversion="6.3" executionTime="192" />
25
+ <tool toolname="Jhove" toolversion="1.16" executionTime="993" />
26
+ <tool toolname="file utility" toolversion="5.25" executionTime="532" />
27
+ <tool toolname="Exiftool" toolversion="10.00" executionTime="532" />
28
+ <tool toolname="NLNZ Metadata Extractor" toolversion="3.6GA" status="did not run" />
29
+ <tool toolname="OIS File Information" toolversion="0.2" executionTime="188" />
30
+ <tool toolname="OIS XML Metadata" toolversion="0.2" status="did not run" />
31
+ <tool toolname="ffident" toolversion="0.2" executionTime="506" />
32
+ <tool toolname="Tika" toolversion="1.10" executionTime="284" />
33
+ </statistics>
34
+ </fits>
35
+
@@ -123,6 +123,15 @@ describe Hydra::Works::CharacterizationService do
123
123
  end
124
124
  end
125
125
 
126
+ context 'using netCDF metadata' do
127
+ let(:fits_filename) { 'fits_netcdf_two_mimetypes.xml' }
128
+ let(:fits_response) { IO.read(File.join(fixture_path, fits_filename)) }
129
+
130
+ it 'reports the correct, single MIME type' do
131
+ expect(file.mime_type).to eq("application/netcdf")
132
+ end
133
+ end
134
+
126
135
  context 'using image metadata' do
127
136
  let(:fits_filename) { 'fits_0.8.5_jp2.xml' }
128
137
  let(:fits_response) { IO.read(File.join(fixture_path, fits_filename)) }
@@ -158,6 +167,16 @@ describe Hydra::Works::CharacterizationService do
158
167
  expect(file.sample_rate).to eq(["44100"])
159
168
  end
160
169
  end
170
+
171
+ context 'using multi-layer tiff metadata' do
172
+ let(:fits_filename) { 'fits_0.8.5_tiff.xml' }
173
+ let(:fits_response) { IO.read(File.join(fixture_path, fits_filename)) }
174
+
175
+ it 'assigns single largest value to width, height' do
176
+ expect(file.width).to eq(["2226"])
177
+ expect(file.height).to eq(["1650"])
178
+ end
179
+ end
161
180
  end
162
181
 
163
182
  describe 'assigned properties from fits 0.6.2' do
@@ -39,7 +39,7 @@ describe Hydra::Works::PersistDerivative do
39
39
  context 'with a video (.avi) file' do
40
40
  let(:mime_type) { 'video/x-msvideo' }
41
41
  let(:file_name) { 'countdown.avi' }
42
- let(:file_set) { Hydra::Works::FileSet.new(id: '01/00') }
42
+ let(:file_set) { Hydra::Works::FileSet.create(id: '01/00') }
43
43
 
44
44
  it 'lacks a thumbnail' do
45
45
  expect(file_set.thumbnail).to be_nil
@@ -55,7 +55,7 @@ describe Hydra::Works::PersistDerivative do
55
55
  context 'with an image file' do
56
56
  let(:mime_type) { 'image/png' }
57
57
  let(:file_name) { 'world.png' }
58
- let(:file_set) { Hydra::Works::FileSet.new(id: '01/01') }
58
+ let(:file_set) { Hydra::Works::FileSet.create(id: '01/01') }
59
59
 
60
60
  it 'lacks a thumbnail' do
61
61
  expect(file_set.thumbnail).to be_nil
@@ -72,7 +72,7 @@ describe Hydra::Works::PersistDerivative do
72
72
  context 'with an audio (.wav) file' do
73
73
  let(:mime_type) { 'audio/wav' }
74
74
  let(:file_name) { 'piano_note.wav' }
75
- let(:file_set) { Hydra::Works::FileSet.new(id: '01/02') }
75
+ let(:file_set) { Hydra::Works::FileSet.create(id: '01/02') }
76
76
 
77
77
  it 'lacks a thumbnail' do
78
78
  expect(file_set.thumbnail).to be_nil
@@ -87,7 +87,7 @@ describe Hydra::Works::PersistDerivative do
87
87
  context 'with an image (.jp2) file' do
88
88
  let(:mime_type) { 'image/jp2' }
89
89
  let(:file_name) { 'image.jp2' }
90
- let(:file_set) { Hydra::Works::FileSet.new(id: '01/03') }
90
+ let(:file_set) { Hydra::Works::FileSet.create(id: '01/03') }
91
91
 
92
92
  it 'lacks a thumbnail' do
93
93
  expect(file_set.thumbnail).to be_nil
@@ -103,7 +103,7 @@ describe Hydra::Works::PersistDerivative do
103
103
  context 'with an office document (.docx) file' do
104
104
  let(:mime_type) { 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' }
105
105
  let(:file_name) { 'charter.docx' }
106
- let(:file_set) { Hydra::Works::FileSet.new(id: '01/04') }
106
+ let(:file_set) { Hydra::Works::FileSet.create(id: '01/04') }
107
107
 
108
108
  it 'lacks a thumbnail' do
109
109
  expect(file_set.thumbnail).to be_nil
@@ -120,7 +120,7 @@ describe Hydra::Works::PersistDerivative do
120
120
  context 'with a pdf document (.pdf) file' do
121
121
  let(:mime_type) { 'application/pdf' }
122
122
  let(:file_name) { 'sample-file.pdf' }
123
- let(:file_set) { Hydra::Works::FileSet.new(id: '01/05') }
123
+ let(:file_set) { Hydra::Works::FileSet.create(id: '01/05') }
124
124
 
125
125
  it 'lacks a thumbnail' do
126
126
  expect(file_set.thumbnail).to be_nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-works
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
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-03-02 00:00:00.000000000 Z
11
+ date: 2018-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hydra-pcdm
@@ -256,7 +256,6 @@ files:
256
256
  - spec/fixtures/Example.ogg
257
257
  - spec/fixtures/charter.docx
258
258
  - spec/fixtures/countdown.avi
259
- - spec/fixtures/eicar.txt
260
259
  - spec/fixtures/fits_0.6.2_avi.xml
261
260
  - spec/fixtures/fits_0.6.2_jp2.xml
262
261
  - spec/fixtures/fits_0.6.2_jpg.xml
@@ -267,6 +266,8 @@ files:
267
266
  - spec/fixtures/fits_0.8.5_mp3.xml
268
267
  - spec/fixtures/fits_0.8.5_mp4.xml
269
268
  - spec/fixtures/fits_0.8.5_pdf.xml
269
+ - spec/fixtures/fits_0.8.5_tiff.xml
270
+ - spec/fixtures/fits_netcdf_two_mimetypes.xml
270
271
  - spec/fixtures/image.jp2
271
272
  - spec/fixtures/pdf_fits.xml
272
273
  - spec/fixtures/piano_note.wav
@@ -325,7 +326,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
325
326
  version: '0'
326
327
  requirements: []
327
328
  rubyforge_project:
328
- rubygems_version: 2.6.10
329
+ rubygems_version: 2.6.14
329
330
  signing_key:
330
331
  specification_version: 4
331
332
  summary: Fundamental repository data model for hydra
@@ -333,7 +334,6 @@ test_files:
333
334
  - spec/fixtures/Example.ogg
334
335
  - spec/fixtures/charter.docx
335
336
  - spec/fixtures/countdown.avi
336
- - spec/fixtures/eicar.txt
337
337
  - spec/fixtures/fits_0.6.2_avi.xml
338
338
  - spec/fixtures/fits_0.6.2_jp2.xml
339
339
  - spec/fixtures/fits_0.6.2_jpg.xml
@@ -344,6 +344,8 @@ test_files:
344
344
  - spec/fixtures/fits_0.8.5_mp3.xml
345
345
  - spec/fixtures/fits_0.8.5_mp4.xml
346
346
  - spec/fixtures/fits_0.8.5_pdf.xml
347
+ - spec/fixtures/fits_0.8.5_tiff.xml
348
+ - spec/fixtures/fits_netcdf_two_mimetypes.xml
347
349
  - spec/fixtures/image.jp2
348
350
  - spec/fixtures/pdf_fits.xml
349
351
  - spec/fixtures/piano_note.wav
@@ -1 +0,0 @@
1
- X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*