assembly-objectfile 1.10.3 → 1.13.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
  SHA256:
3
- metadata.gz: 0060fb5fbd2271cc712b63d2d1ff8752c7ab11346f7ee0a43f41fcc48288d805
4
- data.tar.gz: 1759dd3e2e5c8ab86333957f30b27468296b53b0f4c7e1607f08e09b4f77da9c
3
+ metadata.gz: 8c85bb6c05fe0d46e9b2f37e90710043efce16322c5d58e0b0a9578fd21ece77
4
+ data.tar.gz: c7e3ac5e3f0a0aa2124f8ce3d6587de2d02923c733ee94b1c299ae171101f5a5
5
5
  SHA512:
6
- metadata.gz: a6fa4a4f685bfd3f1c95284b07f8531b1bcdb6330d54b578ad5fefb7e394dd04431bb666930902204b06b44fedeefb9dca0fa9e69939775d27b40df2d41d434a
7
- data.tar.gz: ccd72959056a26a186c32247100a86ffc7596ce3ef960800ada4f7c6677da13548b4e54dd5614c015555676d25264e5850d809fab3da7a968312af071654a984
6
+ metadata.gz: fbad307e9a103af61b4a6b05b35bb6b98953774a2c9bd32cb1404f1a9ff6e3404fe78cfc48f9061bfffaa23c3610f2a6f19df5e08975a20c6ee387073cc1010d
7
+ data.tar.gz: 717e174ccf88a94880f4a832b2d281b351774299fb1273a96b4a1bb942e360cd20b0ba3ac68b7ad4f113e3bd3c78652c7670efcf7bcf8f9bcf068972ba5cd42d
@@ -0,0 +1,14 @@
1
+ version: 2.1
2
+ orbs:
3
+ ruby-rails: sul-dlss/ruby-rails@3.0.1
4
+ workflows:
5
+ build:
6
+ jobs:
7
+ - ruby-rails/lint-gem:
8
+ name: lint
9
+ - ruby-rails/test-gem:
10
+ name: test
11
+ before-test:
12
+ - run:
13
+ name: Install exiftool
14
+ command: curl -L http://cpanmin.us | perl - --sudo Image::ExifTool
@@ -1,12 +1,10 @@
1
- ## Why was this change made?
1
+ ## Why was this change made? 🤔
2
2
 
3
3
 
4
4
 
5
- ## How was this change tested?
5
+ ## How was this change tested? 🤨
6
6
 
7
-
8
-
9
- ## Which documentation and/or configurations were updated?
7
+ ⚡ ⚠ If this change has cross service impact, ***run [integration tests](https://github.com/sul-dlss/infrastructure-integration-test) that do file accessioning*** (e.g. create_preassembly_image_spec) and/or test in [stage|qa] environment, in addition to specs. ⚡
10
8
 
11
9
 
12
10
 
data/.rubocop.yml CHANGED
@@ -2,20 +2,12 @@ inherit_from: .rubocop_todo.yml
2
2
  require: rubocop-rspec
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.5
6
-
7
- RSpec/ContextWording:
8
- Enabled: false # too dogmatic
9
-
10
- RSpec/ExampleLength:
11
- Max: 25
12
-
13
- # we like 'expect(x).to receive' better than 'have_received'
14
- RSpec/MessageSpies:
15
- Enabled: false
16
-
17
- RSpec/NestedGroups:
18
- Max: 4 # default: 3
5
+ TargetRubyVersion: 3.0
6
+ DisplayCopNames: true
7
+ Exclude:
8
+ - 'Gemfile.lock'
9
+ - '**/*.md'
10
+ - 'vendor/**/*' # avoid running rubocop on cached bundler
19
11
 
20
12
  Metrics/BlockLength:
21
13
  Exclude:
@@ -135,3 +127,83 @@ Style/RedundantArgument: # (new in 1.4)
135
127
 
136
128
  Style/SwapValues: # (new in 1.1)
137
129
  Enabled: true
130
+
131
+ Gemspec/RequireMFA: # new in 1.23
132
+ Enabled: true
133
+ Layout/LineEndStringConcatenationIndentation: # new in 1.18
134
+ Enabled: true
135
+ Lint/AmbiguousOperatorPrecedence: # new in 1.21
136
+ Enabled: true
137
+ Lint/AmbiguousRange: # new in 1.19
138
+ Enabled: true
139
+ Lint/EmptyInPattern: # new in 1.16
140
+ Enabled: true
141
+ Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
142
+ Enabled: true
143
+ Lint/RequireRelativeSelfPath: # new in 1.22
144
+ Enabled: true
145
+ Lint/UselessRuby2Keywords: # new in 1.23
146
+ Enabled: true
147
+ Naming/BlockForwarding: # new in 1.24
148
+ Enabled: true
149
+ Security/IoMethods: # new in 1.22
150
+ Enabled: true
151
+ Style/FileRead: # new in 1.24
152
+ Enabled: true
153
+ Style/FileWrite: # new in 1.24
154
+ Enabled: true
155
+ Style/InPatternThen: # new in 1.16
156
+ Enabled: true
157
+ Style/MapToHash: # new in 1.24
158
+ Enabled: true
159
+ Style/MultilineInPatternThen: # new in 1.16
160
+ Enabled: true
161
+ Style/NumberedParameters: # new in 1.22
162
+ Enabled: true
163
+ Style/NumberedParametersLimit: # new in 1.22
164
+ Enabled: true
165
+ Style/OpenStructUse: # new in 1.23
166
+ Enabled: true
167
+ Style/QuotedSymbols: # new in 1.16
168
+ Enabled: true
169
+ Style/RedundantSelfAssignmentBranch: # new in 1.19
170
+ Enabled: true
171
+ Style/SelectByRegexp: # new in 1.22
172
+ Enabled: true
173
+ Style/StringChars: # new in 1.12
174
+ Enabled: true
175
+ RSpec/BeEq: # new in 2.9.0
176
+ Enabled: true
177
+ RSpec/BeNil: # new in 2.9.0
178
+ Enabled: true
179
+ RSpec/ExcessiveDocstringSpacing: # new in 2.5
180
+ Enabled: true
181
+ RSpec/IdenticalEqualityAssertion: # new in 2.4
182
+ Enabled: true
183
+ RSpec/SubjectDeclaration: # new in 2.5
184
+ Enabled: true
185
+ RSpec/FactoryBot/SyntaxMethods: # new in 2.7
186
+ Enabled: true
187
+ RSpec/Rails/AvoidSetupHook: # new in 2.4
188
+ Enabled: true
189
+
190
+ Lint/RefinementImportMethods: # new in 1.27
191
+ Enabled: true
192
+ Security/CompoundHash: # new in 1.28
193
+ Enabled: true
194
+ Style/EnvHome: # new in 1.29
195
+ Enabled: true
196
+ Style/FetchEnvVar: # new in 1.28
197
+ Enabled: true
198
+ Style/MapCompactWithConditionalBlock: # new in 1.30
199
+ Enabled: true
200
+ Style/NestedFileDirname: # new in 1.26
201
+ Enabled: true
202
+ Style/ObjectThen: # new in 1.28
203
+ Enabled: true
204
+ Style/RedundantInitialize: # new in 1.27
205
+ Enabled: true
206
+ RSpec/ChangeByZero: # new in 2.11.0
207
+ Enabled: true
208
+ RSpec/VerifiedDoubleReference: # new in 2.10.0
209
+ Enabled: true
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2021-04-26 18:43:37 UTC using RuboCop version 1.11.0.
3
+ # on 2022-02-28 21:11:02 UTC using RuboCop version 1.25.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -48,7 +48,8 @@ Metrics/PerceivedComplexity:
48
48
  Max: 15
49
49
 
50
50
  # Offense count: 1
51
- # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms.
51
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
52
+ # CheckDefinitionPathHierarchyRoots: lib, spec, test, src
52
53
  # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
53
54
  Naming/FileName:
54
55
  Exclude:
@@ -65,12 +66,18 @@ Naming/PredicateName:
65
66
  - 'spec/**/*'
66
67
  - 'lib/assembly-objectfile/object_fileable.rb'
67
68
 
68
- # Offense count: 9
69
- # Configuration parameters: Max.
70
- RSpec/ExampleLength:
69
+ # Offense count: 1
70
+ # Configuration parameters: Prefixes.
71
+ # Prefixes: when, with, without
72
+ RSpec/ContextWording:
71
73
  Exclude:
72
74
  - 'spec/content_metadata_spec.rb'
73
75
 
76
+ # Offense count: 32
77
+ # Configuration parameters: CountAsOne.
78
+ RSpec/ExampleLength:
79
+ Max: 34
80
+
74
81
  # Offense count: 2
75
82
  # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
76
83
  # Include: **/*_spec*rb*, **/spec/**/*
@@ -85,10 +92,14 @@ RSpec/InstanceVariable:
85
92
  Exclude:
86
93
  - 'spec/object_file_spec.rb'
87
94
 
88
- # Offense count: 40
95
+ # Offense count: 41
89
96
  RSpec/MultipleExpectations:
90
97
  Max: 29
91
98
 
99
+ # Offense count: 20
100
+ RSpec/NestedGroups:
101
+ Max: 4
102
+
92
103
  # Offense count: 2
93
104
  RSpec/RepeatedDescription:
94
105
  Exclude:
@@ -99,7 +110,7 @@ RSpec/RepeatedExample:
99
110
  Exclude:
100
111
  - 'spec/object_file_spec.rb'
101
112
 
102
- # Offense count: 8
113
+ # Offense count: 5
103
114
  RSpec/RepeatedExampleGroupDescription:
104
115
  Exclude:
105
116
  - 'spec/content_metadata_spec.rb'
@@ -110,9 +121,9 @@ Style/CommentedKeyword:
110
121
  Exclude:
111
122
  - 'lib/assembly-objectfile/content_metadata.rb'
112
123
 
113
- # Offense count: 122
124
+ # Offense count: 123
114
125
  # Cop supports --auto-correct.
115
- # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
126
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
116
127
  # URISchemes: http, https
117
128
  Layout/LineLength:
118
129
  Max: 277
data/Gemfile CHANGED
@@ -4,3 +4,5 @@ source 'http://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in .gemspec
6
6
  gemspec
7
+
8
+ gem 'byebug'
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.com/sul-dlss/assembly-objectfile.svg?branch=main)](https://travis-ci.com/sul-dlss/assembly-objectfile)
1
+ [![CircleCI](https://circleci.com/gh/sul-dlss/assembly-objectfile/tree/main.svg?style=svg)](https://circleci.com/gh/sul-dlss/assembly-objectfile/tree/main)
2
2
  [![Test Coverage](https://api.codeclimate.com/v1/badges/2310962acce78d78e76c/test_coverage)](https://codeclimate.com/github/sul-dlss/assembly-objectfile/test_coverage)
3
3
  [![Maintainability](https://api.codeclimate.com/v1/badges/2310962acce78d78e76c/maintainability)](https://codeclimate.com/github/sul-dlss/assembly-objectfile/maintainability)
4
4
  [![Gem Version](https://badge.fury.io/rb/assembly-objectfile.svg)](https://badge.fury.io/rb/assembly-objectfile)
@@ -13,6 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.summary = 'Ruby immplementation of file services needed to prepare objects to be accessioned in SULAIR digital library'
14
14
  s.description = 'Get exif data, file sizes and more.'
15
15
  s.license = 'ALv2'
16
+ s.metadata['rubygems_mfa_required'] = 'true'
16
17
 
17
18
  s.files = `git ls-files`.split("\n")
18
19
  s.test_files = `git ls-files -- spec/*`.split("\n")
@@ -20,7 +21,7 @@ Gem::Specification.new do |s|
20
21
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
22
  s.require_paths = ['lib']
22
23
 
23
- s.required_ruby_version = '~> 2.5'
24
+ s.required_ruby_version = '>= 3.0'
24
25
 
25
26
  s.add_dependency 'activesupport', '>= 5.2.0'
26
27
  s.add_dependency 'deprecation'
@@ -33,7 +34,7 @@ Gem::Specification.new do |s|
33
34
  s.add_development_dependency 'json'
34
35
  s.add_development_dependency 'rake'
35
36
  s.add_development_dependency 'rspec', '~> 3.0'
36
- s.add_development_dependency 'rubocop'
37
+ s.add_development_dependency 'rubocop', '~> 1.25'
37
38
  s.add_development_dependency 'rubocop-rspec'
38
- s.add_development_dependency 'simplecov', '~> 0.17.0' # CodeClimate cannot use SimpleCov >= 0.18.0 for generating test coverage
39
+ s.add_development_dependency 'simplecov'
39
40
  end
@@ -35,7 +35,7 @@ module Assembly
35
35
  @style = style
36
36
  end
37
37
 
38
- delegate :sha1, :md5, :provider_md5, :provider_sha1, :mimetype, :filesize, :image?, to: :file
38
+ delegate :sha1, :md5, :provider_md5, :provider_sha1, :mimetype, :filesize, :image?, :valid_image?, to: :file
39
39
 
40
40
  def file_id(common_path:, flatten_folder_structure:)
41
41
  # set file id attribute, first check the relative_path parameter on the object, and if it is set, just use that
@@ -31,19 +31,19 @@ module Assembly
31
31
  resource_label = fileset.label_from_file(default: default_label)
32
32
 
33
33
  xml.label(resource_label) unless resource_label.empty?
34
- fileset.files.each do |obj| # iterate over all the files in a resource
35
- xml_file_params = { id: obj.file_id(common_path: common_path, flatten_folder_structure: config.flatten_folder_structure) }
36
- xml_file_params.merge!(obj.file_attributes(config.file_attributes)) if config.add_file_attributes
37
- xml_file_params.merge!(mimetype: obj.mimetype, size: obj.filesize) if config.add_exif
34
+ fileset.files.each do |cm_file| # iterate over all the files in a resource
35
+ xml_file_params = { id: cm_file.file_id(common_path: common_path, flatten_folder_structure: config.flatten_folder_structure) }
36
+ xml_file_params.merge!(cm_file.file_attributes(config.file_attributes)) if config.add_file_attributes
37
+ xml_file_params.merge!(mimetype: cm_file.mimetype, size: cm_file.filesize) if config.add_exif
38
38
 
39
39
  xml.file(xml_file_params) do
40
40
  if config.add_exif # add exif info if the user requested it
41
- xml.checksum(obj.sha1, type: 'sha1')
42
- xml.checksum(obj.md5, type: 'md5')
43
- xml.imageData(obj.image_data) if obj.image? # add image data for an image
44
- elsif obj.provider_md5 || obj.provider_sha1 # if we did not add exif info, see if there are user supplied checksums to add
45
- xml.checksum(obj.provider_sha1, type: 'sha1') if obj.provider_sha1
46
- xml.checksum(obj.provider_md5, type: 'md5') if obj.provider_md5
41
+ xml.checksum(cm_file.sha1, type: 'sha1')
42
+ xml.checksum(cm_file.md5, type: 'md5')
43
+ xml.imageData(cm_file.image_data) if cm_file.valid_image? # add image data for an image
44
+ elsif cm_file.provider_md5 || cm_file.provider_sha1 # if we did not add exif info, see if there are user supplied checksums to add
45
+ xml.checksum(cm_file.provider_sha1, type: 'sha1') if cm_file.provider_sha1
46
+ xml.checksum(cm_file.provider_md5, type: 'md5') if cm_file.provider_md5
47
47
  end
48
48
  end
49
49
  end
@@ -91,8 +91,6 @@ module Assembly
91
91
  @exif ||= begin
92
92
  check_for_file
93
93
  MiniExiftool.new(path, replace_invalid_chars: '?')
94
- rescue StandardError
95
- nil
96
94
  end
97
95
  end
98
96
 
@@ -176,8 +174,7 @@ module Assembly
176
174
  @exif_mimetype ||= begin
177
175
  check_for_file
178
176
  prefer_exif = !Assembly::TRUSTED_MIMETYPES.include?(file_mimetype) # if it's not a "trusted" mimetype and there is exif data; get the mimetype from the exif
179
- exif.mimetype if
180
- exif&.mimetype && prefer_exif
177
+ exif.mimetype if exif&.mimetype && prefer_exif
181
178
  end
182
179
  end
183
180
 
@@ -272,7 +269,7 @@ exif&.mimetype && prefer_exif
272
269
 
273
270
  # private method to check for file existence before operating on it
274
271
  def check_for_file
275
- raise "input file #{path} does not exist" unless file_exists?
272
+ raise "input file #{path} does not exist or is a directory" unless file_exists?
276
273
  end
277
274
  end
278
275
  end
@@ -3,7 +3,7 @@
3
3
  # Main Assembly namespace
4
4
  module Assembly
5
5
  class ObjectFile
6
- # Project version number
7
- VERSION = '1.10.3'
6
+ # Gem version
7
+ VERSION = '1.13.0'
8
8
  end
9
9
  end
@@ -9,7 +9,7 @@ RSpec.describe Assembly::ContentMetadata do
9
9
  let(:xml) { Nokogiri::XML(result) }
10
10
 
11
11
  context 'when style=simple_image' do
12
- context 'when using a single tif and jp2' do
12
+ context 'when using a single tif and jp2 with add_exif: true' do
13
13
  it 'generates valid content metadata with exif, adding file attributes' do
14
14
  objects = [Assembly::ObjectFile.new(TEST_TIF_INPUT_FILE), Assembly::ObjectFile.new(TEST_JP2_INPUT_FILE)]
15
15
  result = described_class.create_content_metadata(druid: TEST_DRUID, add_exif: true, add_file_attributes: true, objects: objects)
@@ -44,46 +44,8 @@ RSpec.describe Assembly::ContentMetadata do
44
44
  expect(xml.xpath('//resource/file/imageData')[1].attributes['width'].value).to eq('100')
45
45
  expect(xml.xpath('//resource/file/imageData')[1].attributes['height'].value).to eq('100')
46
46
  end
47
- end
48
47
 
49
- context 'when using a single tif and jp2' do
50
- it 'generates valid content metadata with no exif adding specific file attributes for 2 objects, and defaults for 1 object' do
51
- obj1 = Assembly::ObjectFile.new(TEST_TIF_INPUT_FILE)
52
- obj2 = Assembly::ObjectFile.new(TEST_JP2_INPUT_FILE)
53
- obj3 = Assembly::ObjectFile.new(TEST_JP2_INPUT_FILE2)
54
- obj1.file_attributes = { publish: 'no', preserve: 'no', shelve: 'no' }
55
- obj2.file_attributes = { publish: 'yes', preserve: 'yes', shelve: 'yes' }
56
- objects = [obj1, obj2, obj3]
57
- result = described_class.create_content_metadata(druid: TEST_DRUID, add_exif: false, add_file_attributes: true, objects: objects)
58
- expect(result.class).to be String
59
- xml = Nokogiri::XML(result)
60
- expect(xml.errors.size).to eq 0
61
- expect(xml.xpath('//contentMetadata')[0].attributes['type'].value).to eq('image')
62
- expect(xml.xpath('//resource').length).to eq 3
63
- expect(xml.xpath('//resource/file').length).to eq 3
64
- expect(xml.xpath('//resource/file/checksum').length).to eq 0
65
- expect(xml.xpath('//resource/file/imageData').length).to eq 0
66
- expect(xml.xpath('//label').length).to eq 3
67
- expect(xml.xpath('//label')[0].text).to match(/Image 1/)
68
- expect(xml.xpath('//label')[1].text).to match(/Image 2/)
69
- expect(xml.xpath('//label')[2].text).to match(/Image 3/)
70
- expect(xml.xpath('//resource')[0].attributes['type'].value).to eq('image')
71
- expect(xml.xpath('//resource')[1].attributes['type'].value).to eq('image')
72
- expect(xml.xpath('//resource')[2].attributes['type'].value).to eq('image')
73
- expect(xml.xpath('//resource/file')[0].attributes['publish'].value).to eq('no') # specificially set in object
74
- expect(xml.xpath('//resource/file')[0].attributes['preserve'].value).to eq('no') # specificially set in object
75
- expect(xml.xpath('//resource/file')[0].attributes['shelve'].value).to eq('no') # specificially set in object
76
- expect(xml.xpath('//resource/file')[1].attributes['publish'].value).to eq('yes') # specificially set in object
77
- expect(xml.xpath('//resource/file')[1].attributes['preserve'].value).to eq('yes') # specificially set in object
78
- expect(xml.xpath('//resource/file')[1].attributes['shelve'].value).to eq('yes') # specificially set in object
79
- expect(xml.xpath('//resource/file')[2].attributes['publish'].value).to eq('yes') # defaults by mimetype
80
- expect(xml.xpath('//resource/file')[2].attributes['preserve'].value).to eq('no') # defaults by mimetype
81
- expect(xml.xpath('//resource/file')[2].attributes['shelve'].value).to eq('yes') # defaults by mimetype
82
- end
83
- end
84
-
85
- context 'when using a single tif and jp2' do
86
- it 'generates valid content metadata with exif, overriding file labels' do
48
+ it 'generates valid content metadata, overriding file labels' do
87
49
  objects = [Assembly::ObjectFile.new(TEST_TIF_INPUT_FILE, label: 'Sample tif label!'), Assembly::ObjectFile.new(TEST_JP2_INPUT_FILE, label: 'Sample jp2 label!')]
88
50
  result = described_class.create_content_metadata(druid: TEST_DRUID, add_exif: true, add_file_attributes: true, objects: objects)
89
51
  expect(result.class).to be String
@@ -119,6 +81,42 @@ RSpec.describe Assembly::ContentMetadata do
119
81
  end
120
82
  end
121
83
 
84
+ context 'when using a single tif and jp2 with add_exif: false' do
85
+ it 'generates valid content metadata adding specific file attributes for 2 objects, and defaults for 1 object' do
86
+ obj1 = Assembly::ObjectFile.new(TEST_TIF_INPUT_FILE)
87
+ obj2 = Assembly::ObjectFile.new(TEST_JP2_INPUT_FILE)
88
+ obj3 = Assembly::ObjectFile.new(TEST_JP2_INPUT_FILE2)
89
+ obj1.file_attributes = { publish: 'no', preserve: 'no', shelve: 'no' }
90
+ obj2.file_attributes = { publish: 'yes', preserve: 'yes', shelve: 'yes' }
91
+ objects = [obj1, obj2, obj3]
92
+ result = described_class.create_content_metadata(druid: TEST_DRUID, add_exif: false, add_file_attributes: true, objects: objects)
93
+ expect(result.class).to be String
94
+ xml = Nokogiri::XML(result)
95
+ expect(xml.errors.size).to eq 0
96
+ expect(xml.xpath('//contentMetadata')[0].attributes['type'].value).to eq('image')
97
+ expect(xml.xpath('//resource').length).to eq 3
98
+ expect(xml.xpath('//resource/file').length).to eq 3
99
+ expect(xml.xpath('//resource/file/checksum').length).to eq 0
100
+ expect(xml.xpath('//resource/file/imageData').length).to eq 0
101
+ expect(xml.xpath('//label').length).to eq 3
102
+ expect(xml.xpath('//label')[0].text).to match(/Image 1/)
103
+ expect(xml.xpath('//label')[1].text).to match(/Image 2/)
104
+ expect(xml.xpath('//label')[2].text).to match(/Image 3/)
105
+ expect(xml.xpath('//resource')[0].attributes['type'].value).to eq('image')
106
+ expect(xml.xpath('//resource')[1].attributes['type'].value).to eq('image')
107
+ expect(xml.xpath('//resource')[2].attributes['type'].value).to eq('image')
108
+ expect(xml.xpath('//resource/file')[0].attributes['publish'].value).to eq('no') # specificially set in object
109
+ expect(xml.xpath('//resource/file')[0].attributes['preserve'].value).to eq('no') # specificially set in object
110
+ expect(xml.xpath('//resource/file')[0].attributes['shelve'].value).to eq('no') # specificially set in object
111
+ expect(xml.xpath('//resource/file')[1].attributes['publish'].value).to eq('yes') # specificially set in object
112
+ expect(xml.xpath('//resource/file')[1].attributes['preserve'].value).to eq('yes') # specificially set in object
113
+ expect(xml.xpath('//resource/file')[1].attributes['shelve'].value).to eq('yes') # specificially set in object
114
+ expect(xml.xpath('//resource/file')[2].attributes['publish'].value).to eq('yes') # defaults by mimetype
115
+ expect(xml.xpath('//resource/file')[2].attributes['preserve'].value).to eq('no') # defaults by mimetype
116
+ expect(xml.xpath('//resource/file')[2].attributes['shelve'].value).to eq('yes') # defaults by mimetype
117
+ end
118
+ end
119
+
122
120
  context 'when using a single tif and jp2' do
123
121
  it 'generates valid content metadata with exif, overriding file labels for one, and skipping auto labels for the others or for where the label is set but is blank' do
124
122
  objects = [Assembly::ObjectFile.new(TEST_TIF_INPUT_FILE, label: 'Sample tif label!'), Assembly::ObjectFile.new(TEST_JP2_INPUT_FILE), Assembly::ObjectFile.new(TEST_JP2_INPUT_FILE, label: '')]
@@ -331,6 +329,26 @@ RSpec.describe Assembly::ContentMetadata do
331
329
  end
332
330
  end
333
331
  end
332
+
333
+ context 'when using a single svg with add_exif: true' do
334
+ subject(:result) { described_class.create_content_metadata(druid: TEST_DRUID, add_exif: true, auto_labels: false, add_file_attributes: true, objects: objects) }
335
+
336
+ let(:objects) { [Assembly::ObjectFile.new(TEST_SVG_INPUT_FILE)] }
337
+
338
+ it 'generates no imageData node' do
339
+ xml = Nokogiri::XML(result)
340
+ expect(xml.errors.size).to eq 0
341
+ expect(xml.xpath('//contentMetadata')[0].attributes['type'].value).to eq('image')
342
+ expect(xml.xpath('//resource/file').length).to eq 1
343
+ expect(xml.xpath('//resource/file')[0]['mimetype']).to eq 'image/svg+xml'
344
+ expect(xml.xpath('//resource/file')[0]['publish']).to eq('no')
345
+ expect(xml.xpath('//resource/file')[0]['preserve']).to eq('yes')
346
+ expect(xml.xpath('//resource/file')[0]['shelve']).to eq('no')
347
+ expect(xml.xpath("//resource[@sequence='1']/file").length).to eq 1
348
+ expect(xml.xpath('//imageData')).not_to be_present
349
+ expect(xml.xpath('//resource')[0].attributes['type'].value).to eq('image')
350
+ end
351
+ end
334
352
  end
335
353
 
336
354
  context 'when style=webarchive-seed' do
@@ -4,10 +4,10 @@ require 'spec_helper'
4
4
 
5
5
  describe Assembly::ObjectFile do
6
6
  it 'does not run if no input file is passed in' do
7
- @ai = described_class.new('')
8
- expect { @ai.filesize }.to raise_error(RuntimeError, 'input file does not exist')
9
- expect { @ai.sha1 }.to raise_error(RuntimeError, 'input file does not exist')
10
- expect { @ai.md5 }.to raise_error(RuntimeError, 'input file does not exist')
7
+ object_file = described_class.new('')
8
+ expect { object_file.filesize }.to raise_error(RuntimeError, 'input file does not exist or is a directory')
9
+ expect { object_file.sha1 }.to raise_error(RuntimeError, 'input file does not exist or is a directory')
10
+ expect { object_file.md5 }.to raise_error(RuntimeError, 'input file does not exist or is a directory')
11
11
  end
12
12
 
13
13
  it 'returns the common directory of a set of filenames passed into it, where the common part does not terminate on a directory' do
@@ -20,191 +20,191 @@ describe Assembly::ObjectFile do
20
20
 
21
21
  it 'tells us if an input file is an image' do
22
22
  expect(File.exist?(TEST_TIF_INPUT_FILE)).to be true
23
- @ai = described_class.new(TEST_TIF_INPUT_FILE)
24
- expect(@ai.image?).to eq(true)
25
- expect(@ai.exif).not_to be nil
26
- expect(@ai.mimetype).to eq('image/tiff')
27
- expect(@ai.file_mimetype).to eq('image/tiff')
28
- expect(@ai.extension_mimetype).to eq('image/tiff')
29
- expect(@ai.exif_mimetype).to eq('image/tiff')
30
- expect(@ai.object_type).to eq(:image)
31
- expect(@ai.valid_image?).to eq(true)
32
- expect(@ai.jp2able?).to eq(true)
23
+ object_file = described_class.new(TEST_TIF_INPUT_FILE)
24
+ expect(object_file.image?).to be(true)
25
+ expect(object_file.exif).not_to be_nil
26
+ expect(object_file.mimetype).to eq('image/tiff')
27
+ expect(object_file.file_mimetype).to eq('image/tiff')
28
+ expect(object_file.extension_mimetype).to eq('image/tiff')
29
+ expect(object_file.exif_mimetype).to eq('image/tiff')
30
+ expect(object_file.object_type).to eq(:image)
31
+ expect(object_file.valid_image?).to be(true)
32
+ expect(object_file.jp2able?).to be(true)
33
33
  end
34
34
 
35
35
  it 'tells us information about the input file' do
36
- @ai = described_class.new(TEST_TIF_INPUT_FILE)
37
- expect(@ai.filename).to eq('test.tif')
38
- expect(@ai.ext).to eq('.tif')
39
- expect(@ai.filename_without_ext).to eq('test')
40
- expect(@ai.dirname).to eq(File.dirname(TEST_TIF_INPUT_FILE))
36
+ object_file = described_class.new(TEST_TIF_INPUT_FILE)
37
+ expect(object_file.filename).to eq('test.tif')
38
+ expect(object_file.ext).to eq('.tif')
39
+ expect(object_file.filename_without_ext).to eq('test')
40
+ expect(object_file.dirname).to eq(File.dirname(TEST_TIF_INPUT_FILE))
41
41
  end
42
42
 
43
43
  it 'sets the correct mimetype of plain/text for .txt files' do
44
- @ai = described_class.new(TEST_RES1_TEXT)
45
- expect(@ai.mimetype).to eq('text/plain')
44
+ object_file = described_class.new(TEST_RES1_TEXT)
45
+ expect(object_file.mimetype).to eq('text/plain')
46
46
  end
47
47
 
48
48
  it 'sets the correct mimetype of plain/text for .xml files' do
49
- @ai = described_class.new(TEST_RES1_TEXT)
50
- expect(@ai.mimetype).to eq('text/plain')
49
+ object_file = described_class.new(TEST_RES1_TEXT)
50
+ expect(object_file.mimetype).to eq('text/plain')
51
51
  end
52
52
 
53
53
  it 'sets the correct mimetype of plain/text for .obj 3d files' do
54
- @ai = described_class.new(TEST_OBJ_FILE)
55
- expect(@ai.mimetype).to eq('text/plain')
54
+ object_file = described_class.new(TEST_OBJ_FILE)
55
+ expect(object_file.mimetype).to eq('text/plain')
56
56
  end
57
57
 
58
58
  it 'sets a mimetype of application/x-tgif for .obj 3d files if we prefer the mimetype extension gem over unix file system command' do
59
- @ai = described_class.new(TEST_OBJ_FILE, mime_type_order: %i[extension file exif])
60
- expect(@ai.mimetype).to eq('application/x-tgif')
59
+ object_file = described_class.new(TEST_OBJ_FILE, mime_type_order: %i[extension file exif])
60
+ expect(object_file.mimetype).to eq('application/x-tgif')
61
61
  end
62
62
 
63
63
  it 'ignores invald mimetype generation methods and still sets a mimetype of application/x-tgif for .obj 3d files if we prefer the mimetype extension gem over unix file system command' do
64
- @ai = described_class.new(TEST_OBJ_FILE, mime_type_order: %i[bogus extension file])
65
- expect(@ai.mimetype).to eq('application/x-tgif')
64
+ object_file = described_class.new(TEST_OBJ_FILE, mime_type_order: %i[bogus extension file])
65
+ expect(object_file.mimetype).to eq('application/x-tgif')
66
66
  end
67
67
 
68
68
  it 'sets the correct mimetype of plain/text for .ply 3d files' do
69
- @ai = described_class.new(TEST_PLY_FILE)
70
- expect(@ai.mimetype).to eq('text/plain')
69
+ object_file = described_class.new(TEST_PLY_FILE)
70
+ expect(object_file.mimetype).to eq('text/plain')
71
71
  end
72
72
 
73
73
  it 'overrides the mimetype generators and uses the manual mapping to set the correct mimetype of application/json for a .json file' do
74
- @ai = described_class.new(TEST_JSON_FILE)
75
- expect(@ai.exif_mimetype).to be_nil # exif returns nil
76
- expect(@ai.file_mimetype).to eq('text/plain') # unix file system command returns plain text
77
- expect(@ai.mimetype).to eq('application/json') # but our configured mapping overrides both and returns application/json
74
+ object_file = described_class.new(TEST_JSON_FILE)
75
+ expect(object_file.exif_mimetype).to be_nil # exif returns nil
76
+ expect(object_file.file_mimetype).to eq('text/plain') # unix file system command returns plain text
77
+ expect(object_file.mimetype).to eq('application/json') # but our configured mapping overrides both and returns application/json
78
78
  end
79
79
 
80
80
  it 'sets the correct mimetype of image/tiff for .tif files' do
81
- @ai = described_class.new(TEST_TIF_INPUT_FILE)
82
- expect(@ai.mimetype).to eq('image/tiff')
81
+ object_file = described_class.new(TEST_TIF_INPUT_FILE)
82
+ expect(object_file.mimetype).to eq('image/tiff')
83
83
  end
84
84
 
85
85
  it 'sets the correct mimetype of image/jp2 for .jp2 files' do
86
- @ai = described_class.new(TEST_JP2_INPUT_FILE)
87
- expect(@ai.mimetype).to eq('image/jp2')
86
+ object_file = described_class.new(TEST_JP2_INPUT_FILE)
87
+ expect(object_file.mimetype).to eq('image/jp2')
88
88
  end
89
89
 
90
90
  it 'sets the correct mimetype of application/pdf for .pdf files' do
91
- @ai = described_class.new(TEST_RES1_PDF)
92
- expect(@ai.mimetype).to eq('application/pdf')
91
+ object_file = described_class.new(TEST_RES1_PDF)
92
+ expect(object_file.mimetype).to eq('application/pdf')
93
93
  end
94
94
 
95
95
  it 'gives us the mimetype of a file even if the exif information is damaged' do
96
- @ai = described_class.new(TEST_FILE_NO_EXIF)
97
- expect(@ai.filename).to eq('file_with_no_exif.xml')
98
- expect(@ai.ext).to eq('.xml')
99
- expect(['text/html', 'application/xml'].include?(@ai.mimetype)).to be true # we could get either of these mimetypes depending on the OS
96
+ object_file = described_class.new(TEST_FILE_NO_EXIF)
97
+ expect(object_file.filename).to eq('file_with_no_exif.xml')
98
+ expect(object_file.ext).to eq('.xml')
99
+ expect(['text/html', 'application/xml'].include?(object_file.mimetype)).to be true # we could get either of these mimetypes depending on the OS
100
100
  end
101
101
 
102
102
  it 'gives us the DPG base name for a file' do
103
103
  test_file = File.join(TEST_INPUT_DIR, 'oo000oo0001_00_001.tif')
104
- @ai = described_class.new(test_file)
105
- expect(@ai.dpg_basename).to eq('oo000oo0001_001')
104
+ object_file = described_class.new(test_file)
105
+ expect(object_file.dpg_basename).to eq('oo000oo0001_001')
106
106
  end
107
107
 
108
108
  it 'gives us the DPG subfolder name for a file' do
109
109
  test_file = File.join(TEST_INPUT_DIR, 'oo000oo0001_05_001.tif')
110
- @ai = described_class.new(test_file)
111
- expect(@ai.dpg_folder).to eq('05')
110
+ object_file = described_class.new(test_file)
111
+ expect(object_file.dpg_folder).to eq('05')
112
112
  end
113
113
 
114
114
  it 'tells us that a jp2 file is not jp2able but does have a color profile' do
115
115
  expect(File.exist?(TEST_JP2_INPUT_FILE)).to be true
116
- @ai = described_class.new(TEST_JP2_INPUT_FILE)
117
- expect(@ai.image?).to eq(true)
118
- expect(@ai.object_type).to eq(:image)
119
- expect(@ai.valid_image?).to eq(true)
120
- expect(@ai.jp2able?).to eq(false)
121
- expect(@ai.has_color_profile?).to eq(true)
116
+ object_file = described_class.new(TEST_JP2_INPUT_FILE)
117
+ expect(object_file.image?).to be(true)
118
+ expect(object_file.object_type).to eq(:image)
119
+ expect(object_file.valid_image?).to be(true)
120
+ expect(object_file.jp2able?).to be(false)
121
+ expect(object_file.has_color_profile?).to be(true)
122
122
  end
123
123
 
124
124
  it 'tells us that a tiff file is jp2able and has a color profile' do
125
125
  expect(File.exist?(TEST_RES1_TIF1)).to be true
126
- @ai = described_class.new(TEST_RES1_TIF1)
127
- expect(@ai.image?).to eq(true)
128
- expect(@ai.object_type).to eq(:image)
129
- expect(@ai.valid_image?).to eq(true)
130
- expect(@ai.jp2able?).to eq(true)
131
- expect(@ai.has_color_profile?).to eq(true)
126
+ object_file = described_class.new(TEST_RES1_TIF1)
127
+ expect(object_file.image?).to be(true)
128
+ expect(object_file.object_type).to eq(:image)
129
+ expect(object_file.valid_image?).to be(true)
130
+ expect(object_file.jp2able?).to be(true)
131
+ expect(object_file.has_color_profile?).to be(true)
132
132
  end
133
133
 
134
134
  it 'tells us that a tiff file is not jp2able and is not valid since it has no profile' do
135
135
  expect(File.exist?(TEST_TIFF_NO_COLOR_FILE)).to be true
136
- @ai = described_class.new(TEST_TIFF_NO_COLOR_FILE)
137
- expect(@ai.image?).to eq(true)
138
- expect(@ai.object_type).to eq(:image)
139
- expect(@ai.valid_image?).to eq(true)
140
- expect(@ai.jp2able?).to eq(true)
141
- expect(@ai.has_color_profile?).to eq(false)
136
+ object_file = described_class.new(TEST_TIFF_NO_COLOR_FILE)
137
+ expect(object_file.image?).to be(true)
138
+ expect(object_file.object_type).to eq(:image)
139
+ expect(object_file.valid_image?).to be(true)
140
+ expect(object_file.jp2able?).to be(true)
141
+ expect(object_file.has_color_profile?).to be(false)
142
142
  end
143
143
 
144
144
  it 'computes checksums for an image file' do
145
145
  expect(File.exist?(TEST_TIF_INPUT_FILE)).to be true
146
- @ai = described_class.new(TEST_TIF_INPUT_FILE)
147
- expect(@ai.md5).to eq('a2400500acf21e43f5440d93be894101')
148
- expect(@ai.sha1).to eq('8d11fab63089a24c8b17063d29a4b0eac359fb41')
146
+ object_file = described_class.new(TEST_TIF_INPUT_FILE)
147
+ expect(object_file.md5).to eq('a2400500acf21e43f5440d93be894101')
148
+ expect(object_file.sha1).to eq('8d11fab63089a24c8b17063d29a4b0eac359fb41')
149
149
  end
150
150
 
151
151
  it 'indicates that the file is not found when a valid directory is supplied instead of a file or when an invalid file path is specified' do
152
152
  path = Assembly::PATH_TO_GEM
153
- @ai = described_class.new(path)
153
+ object_file = described_class.new(path)
154
154
  expect(File.exist?(path)).to be true
155
155
  expect(File.directory?(path)).to be true
156
- expect(@ai.file_exists?).to be false
156
+ expect(object_file.file_exists?).to be false
157
157
 
158
158
  path = File.join(Assembly::PATH_TO_GEM, 'bogus.txt')
159
- @ai = described_class.new(path)
159
+ object_file = described_class.new(path)
160
160
  expect(File.exist?(path)).to be false
161
161
  expect(File.directory?(path)).to be false
162
- expect(@ai.file_exists?).to be false
162
+ expect(object_file.file_exists?).to be false
163
163
  end
164
164
 
165
165
  it 'sets attributes correctly when initializing' do
166
- @ai = described_class.new('/some/file.txt')
167
- expect(@ai.path).to eq('/some/file.txt')
168
- expect(@ai.label).to be_nil
169
- expect(@ai.file_attributes).to be_nil
170
- expect(@ai.provider_sha1).to be_nil
171
- expect(@ai.provider_md5).to be_nil
172
- expect(@ai.relative_path).to be_nil
173
-
174
- @ai = described_class.new('/some/file.txt', label: 'some label', file_attributes: { 'shelve' => 'yes', 'publish' => 'yes', 'preserve' => 'no' }, relative_path: '/tmp')
175
- expect(@ai.path).to eq('/some/file.txt')
176
- expect(@ai.label).to eq('some label')
177
- expect(@ai.file_attributes).to eq('shelve' => 'yes', 'publish' => 'yes', 'preserve' => 'no')
178
- expect(@ai.provider_sha1).to be_nil
179
- expect(@ai.provider_md5).to be_nil
180
- expect(@ai.relative_path).to eq('/tmp')
166
+ object_file = described_class.new('/some/file.txt')
167
+ expect(object_file.path).to eq('/some/file.txt')
168
+ expect(object_file.label).to be_nil
169
+ expect(object_file.file_attributes).to be_nil
170
+ expect(object_file.provider_sha1).to be_nil
171
+ expect(object_file.provider_md5).to be_nil
172
+ expect(object_file.relative_path).to be_nil
173
+
174
+ object_file = described_class.new('/some/file.txt', label: 'some label', file_attributes: { 'shelve' => 'yes', 'publish' => 'yes', 'preserve' => 'no' }, relative_path: '/tmp')
175
+ expect(object_file.path).to eq('/some/file.txt')
176
+ expect(object_file.label).to eq('some label')
177
+ expect(object_file.file_attributes).to eq('shelve' => 'yes', 'publish' => 'yes', 'preserve' => 'no')
178
+ expect(object_file.provider_sha1).to be_nil
179
+ expect(object_file.provider_md5).to be_nil
180
+ expect(object_file.relative_path).to eq('/tmp')
181
181
  end
182
182
 
183
183
  it 'sets md5_provider attribute' do
184
- ai = described_class.new('/some/file.txt', provider_md5: 'XYZ')
185
- expect(ai.provider_md5).to eq('XYZ')
184
+ object_file = described_class.new('/some/file.txt', provider_md5: 'XYZ')
185
+ expect(object_file.provider_md5).to eq('XYZ')
186
186
  end
187
187
 
188
188
  it 'tells us if an input file is not an image' do
189
189
  non_image_file = File.join(Assembly::PATH_TO_GEM, 'spec/object_file_spec.rb')
190
190
  expect(File.exist?(non_image_file)).to be true
191
- @ai = described_class.new(non_image_file)
192
- expect(@ai.image?).to eq(false)
193
- expect(@ai.object_type).not_to eq(:image)
194
- expect(@ai.valid_image?).to eq(false)
191
+ object_file = described_class.new(non_image_file)
192
+ expect(object_file.image?).to be(false)
193
+ expect(object_file.object_type).not_to eq(:image)
194
+ expect(object_file.valid_image?).to be(false)
195
195
 
196
196
  non_image_file = File.join(Assembly::PATH_TO_GEM, 'spec/test_data/input/file_with_no_exif.xml')
197
197
  expect(File.exist?(non_image_file)).to be true
198
- @ai = described_class.new(non_image_file)
199
- expect(@ai.image?).to eq(false)
200
- expect(@ai.object_type).not_to eq(:image)
201
- expect(@ai.valid_image?).to eq(false)
198
+ object_file = described_class.new(non_image_file)
199
+ expect(object_file.image?).to be(false)
200
+ expect(object_file.object_type).not_to eq(:image)
201
+ expect(object_file.valid_image?).to be(false)
202
202
  end
203
203
 
204
204
  it 'tells us the size of an input file' do
205
205
  expect(File.exist?(TEST_TIF_INPUT_FILE)).to be true
206
- @ai = described_class.new(TEST_TIF_INPUT_FILE)
207
- expect(@ai.filesize).to eq(63_542)
206
+ object_file = described_class.new(TEST_TIF_INPUT_FILE)
207
+ expect(object_file.filesize).to eq(63_542)
208
208
  end
209
209
 
210
210
  it 'tells us the mimetype and encoding of an input file' do
@@ -214,4 +214,9 @@ describe Assembly::ObjectFile do
214
214
  expect(@ai.file_mimetype).to eq('image/tiff')
215
215
  expect(@ai.encoding).to eq('binary')
216
216
  end
217
+
218
+ it 'raises MiniExiftool::Error if exiftool raises one' do
219
+ object_file = described_class.new('spec/test_data/empty.txt')
220
+ expect { object_file.exif }.to raise_error(MiniExiftool::Error)
221
+ end
217
222
  end
data/spec/spec_helper.rb CHANGED
@@ -3,8 +3,8 @@
3
3
  require 'simplecov'
4
4
  SimpleCov.start
5
5
 
6
- bootfile = File.expand_path("#{File.dirname(__FILE__)}/../config/boot")
7
- require bootfile
6
+ require File.expand_path("#{File.dirname(__FILE__)}/../config/boot")
7
+ require 'byebug'
8
8
 
9
9
  RSpec.configure do |config|
10
10
  config.order = 'random'
@@ -18,6 +18,7 @@ TEST_TIF_INPUT_FILE2 = File.join(TEST_INPUT_DIR, 'test2.tif')
18
18
  TEST_JPEG_INPUT_FILE = File.join(TEST_INPUT_DIR, 'test.jpg')
19
19
  TEST_JP2_INPUT_FILE = File.join(TEST_INPUT_DIR, 'test.jp2')
20
20
  TEST_JP2_INPUT_FILE2 = File.join(TEST_INPUT_DIR, 'test2.jp2')
21
+ TEST_SVG_INPUT_FILE = File.join(TEST_INPUT_DIR, 'test.svg')
21
22
  TEST_JP2_OUTPUT_FILE = File.join(TEST_OUTPUT_DIR, 'test.jp2')
22
23
  TEST_PDF_FILE = File.join(TEST_INPUT_DIR, 'test.pdf')
23
24
 
File without changes
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="507.3" height="508.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" overflow="hidden"><defs><clipPath id="clip0"><rect x="2361" y="213" width="507" height="508"/></clipPath></defs><g clip-path="url(#clip0)" transform="translate(-2361 -213)"><path d="M2361 467C2361 326.72 2474.5 213 2614.5 213 2754.5 213 2868 326.72 2868 467 2868 607.28 2754.5 721 2614.5 721 2474.5 721 2361 607.28 2361 467Z" fill="#BF9000" fill-rule="evenodd"/></g></svg>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assembly-objectfile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.3
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Mangiafico
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2021-04-26 00:00:00.000000000 Z
14
+ date: 2022-06-03 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -157,16 +157,16 @@ dependencies:
157
157
  name: rubocop
158
158
  requirement: !ruby/object:Gem::Requirement
159
159
  requirements:
160
- - - ">="
160
+ - - "~>"
161
161
  - !ruby/object:Gem::Version
162
- version: '0'
162
+ version: '1.25'
163
163
  type: :development
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
166
166
  requirements:
167
- - - ">="
167
+ - - "~>"
168
168
  - !ruby/object:Gem::Version
169
- version: '0'
169
+ version: '1.25'
170
170
  - !ruby/object:Gem::Dependency
171
171
  name: rubocop-rspec
172
172
  requirement: !ruby/object:Gem::Requirement
@@ -185,16 +185,16 @@ dependencies:
185
185
  name: simplecov
186
186
  requirement: !ruby/object:Gem::Requirement
187
187
  requirements:
188
- - - "~>"
188
+ - - ">="
189
189
  - !ruby/object:Gem::Version
190
- version: 0.17.0
190
+ version: '0'
191
191
  type: :development
192
192
  prerelease: false
193
193
  version_requirements: !ruby/object:Gem::Requirement
194
194
  requirements:
195
- - - "~>"
195
+ - - ">="
196
196
  - !ruby/object:Gem::Version
197
- version: 0.17.0
197
+ version: '0'
198
198
  description: Get exif data, file sizes and more.
199
199
  email:
200
200
  - pmangiafico@stanford.edu
@@ -202,13 +202,13 @@ executables: []
202
202
  extensions: []
203
203
  extra_rdoc_files: []
204
204
  files:
205
+ - ".circleci/config.yml"
205
206
  - ".github/ISSUE_TEMPLATE/bug_report.md"
206
207
  - ".github/pull_request_template.md"
207
208
  - ".gitignore"
208
209
  - ".rubocop.yml"
209
210
  - ".rubocop_todo.yml"
210
211
  - ".rvmrc.example"
211
- - ".travis.yml"
212
212
  - Gemfile
213
213
  - LICENSE
214
214
  - README.md
@@ -233,6 +233,7 @@ files:
233
233
  - spec/content_metadata_spec.rb
234
234
  - spec/object_file_spec.rb
235
235
  - spec/spec_helper.rb
236
+ - spec/test_data/empty.txt
236
237
  - spec/test_data/input/.empty
237
238
  - spec/test_data/input/file_with_no_exif.xml
238
239
  - spec/test_data/input/oo000oo0001/00/oo000oo0001_00_001.tif
@@ -265,6 +266,7 @@ files:
265
266
  - spec/test_data/input/test.jp2
266
267
  - spec/test_data/input/test.json
267
268
  - spec/test_data/input/test.pdf
269
+ - spec/test_data/input/test.svg
268
270
  - spec/test_data/input/test.tif
269
271
  - spec/test_data/input/test2.jp2
270
272
  - spec/test_data/input/test2.tif
@@ -272,23 +274,24 @@ files:
272
274
  homepage: https://github.com/sul-dlss/assembly-objectfile
273
275
  licenses:
274
276
  - ALv2
275
- metadata: {}
277
+ metadata:
278
+ rubygems_mfa_required: 'true'
276
279
  post_install_message:
277
280
  rdoc_options: []
278
281
  require_paths:
279
282
  - lib
280
283
  required_ruby_version: !ruby/object:Gem::Requirement
281
284
  requirements:
282
- - - "~>"
285
+ - - ">="
283
286
  - !ruby/object:Gem::Version
284
- version: '2.5'
287
+ version: '3.0'
285
288
  required_rubygems_version: !ruby/object:Gem::Requirement
286
289
  requirements:
287
290
  - - ">="
288
291
  - !ruby/object:Gem::Version
289
292
  version: '0'
290
293
  requirements: []
291
- rubygems_version: 3.2.16
294
+ rubygems_version: 3.2.32
292
295
  signing_key:
293
296
  specification_version: 4
294
297
  summary: Ruby immplementation of file services needed to prepare objects to be accessioned
@@ -297,6 +300,7 @@ test_files:
297
300
  - spec/content_metadata_spec.rb
298
301
  - spec/object_file_spec.rb
299
302
  - spec/spec_helper.rb
303
+ - spec/test_data/empty.txt
300
304
  - spec/test_data/input/.empty
301
305
  - spec/test_data/input/file_with_no_exif.xml
302
306
  - spec/test_data/input/oo000oo0001/00/oo000oo0001_00_001.tif
@@ -329,6 +333,7 @@ test_files:
329
333
  - spec/test_data/input/test.jp2
330
334
  - spec/test_data/input/test.json
331
335
  - spec/test_data/input/test.pdf
336
+ - spec/test_data/input/test.svg
332
337
  - spec/test_data/input/test.tif
333
338
  - spec/test_data/input/test2.jp2
334
339
  - spec/test_data/input/test2.tif
data/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.5.7
4
- - 2.6.5
5
- addons:
6
- apt:
7
- packages:
8
- - libimage-exiftool-perl
9
- before_script:
10
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11
- - chmod +x ./cc-test-reporter
12
- - ./cc-test-reporter before-build
13
- script:
14
- - bundle exec rubocop
15
- - bundle exec rake
16
- after_script:
17
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
18
-
19
- notifications:
20
- email: false