riiif 2.3.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +46 -0
- data/.rubocop_todo.yml +108 -15
- data/README.md +1 -3
- data/app/controllers/riiif/images_controller.rb +1 -1
- data/app/models/riiif/image.rb +0 -3
- data/app/resolvers/riiif/akubra_system_file_resolver.rb +1 -0
- data/app/resolvers/riiif/file_system_file_resolver.rb +1 -1
- data/app/resolvers/riiif/http_file_resolver.rb +9 -1
- data/app/services/riiif/image_magick_info_extractor.rb +1 -1
- data/app/services/riiif/imagemagick_command_factory.rb +1 -1
- data/lib/riiif/version.rb +1 -1
- data/riiif.gemspec +6 -6
- data/spec/controllers/riiif/images_controller_spec.rb +7 -7
- data/spec/models/riiif/file_system_file_resolver_spec.rb +7 -0
- data/spec/models/riiif/image_spec.rb +6 -0
- data/spec/spec_helper.rb +0 -6
- metadata +15 -15
- data/.travis.yml +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d88fa024e853f81b2c6a4fb9a722357d45537e1e6c235aafb165e1dc5fc0f017
|
4
|
+
data.tar.gz: 775234812041bad9fbf9340540799baf9e6740e9cd11d43eca5c51eead07ef28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eed458967ef79c6f0458fdb9ca6a07ad9442bd487d5dc29f6b8b828649aa37317410b7bd210de93ebc1438990179b2c33b3af196396ed2eebbdd28249416e29d
|
7
|
+
data.tar.gz: cd607c37c612833ab41b90e5beba46891421f8e44e93d0a1c609542dbe857786871926c1ebb44652a44725df9658517c87ee58a80d3d91c5de43b96376d37b85
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: CI
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches:
|
13
|
+
- master
|
14
|
+
pull_request:
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
strategy:
|
20
|
+
matrix:
|
21
|
+
ruby: ['3.1', '3.2']
|
22
|
+
rails: ['7.0.8']
|
23
|
+
include:
|
24
|
+
- ruby: '2.7'
|
25
|
+
rails: '5.2.3'
|
26
|
+
- ruby: '2.7'
|
27
|
+
rails: '6.0.6.1'
|
28
|
+
- ruby: '3.0'
|
29
|
+
rails: '6.0.6.1'
|
30
|
+
- ruby: '3.1'
|
31
|
+
rails: '6.1.7.6'
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@v2
|
34
|
+
- name: Set up Ruby
|
35
|
+
uses: ruby/setup-ruby@v1
|
36
|
+
with:
|
37
|
+
ruby-version: ${{ matrix.ruby }}
|
38
|
+
- name: Install dependencies
|
39
|
+
run: bundle install
|
40
|
+
env:
|
41
|
+
RAILS_VERSION: ${{ matrix.rails }}
|
42
|
+
- name: Run tests
|
43
|
+
run: bundle exec rake
|
44
|
+
env:
|
45
|
+
RAILS_VERSION: ${{ matrix.rails }}
|
46
|
+
ENGINE_CART_RAILS_OPTIONS: '--skip-git --skip-listen --skip-spring --skip-keeps --skip-action-cable --skip-coffee --skip-test'
|
data/.rubocop_todo.yml
CHANGED
@@ -1,16 +1,54 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2022-02-28 10:01:41 -0800 using RuboCop version 0.85.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
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 6
|
10
|
+
# Cop supports --auto-correct.
|
11
|
+
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
12
|
+
# SupportedHashRocketStyles: key, separator, table
|
13
|
+
# SupportedColonStyles: key, separator, table
|
14
|
+
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
15
|
+
Layout/HashAlignment:
|
16
|
+
Exclude:
|
17
|
+
- 'spec/controllers/riiif/images_controller_spec.rb'
|
18
|
+
|
19
|
+
# Offense count: 62
|
20
|
+
# Cop supports --auto-correct.
|
21
|
+
# Configuration parameters: EnforcedStyle.
|
22
|
+
# SupportedStyles: normal, indented_internal_methods
|
23
|
+
Layout/IndentationConsistency:
|
24
|
+
Exclude:
|
25
|
+
- 'app/controllers/riiif/images_controller.rb'
|
26
|
+
- 'app/resolvers/riiif/file_system_file_resolver.rb'
|
27
|
+
- 'app/resolvers/riiif/http_file_resolver.rb'
|
28
|
+
- 'app/services/riiif/crop.rb'
|
29
|
+
- 'app/services/riiif/imagemagick_command_factory.rb'
|
30
|
+
- 'app/services/riiif/kakadu_command_factory.rb'
|
31
|
+
- 'app/services/riiif/resize.rb'
|
32
|
+
- 'app/transformers/riiif/kakadu_transformer.rb'
|
33
|
+
|
34
|
+
# Offense count: 62
|
35
|
+
# Cop supports --auto-correct.
|
36
|
+
# Configuration parameters: Width, IgnoredPatterns.
|
37
|
+
Layout/IndentationWidth:
|
38
|
+
Exclude:
|
39
|
+
- 'app/controllers/riiif/images_controller.rb'
|
40
|
+
- 'app/resolvers/riiif/file_system_file_resolver.rb'
|
41
|
+
- 'app/resolvers/riiif/http_file_resolver.rb'
|
42
|
+
- 'app/services/riiif/crop.rb'
|
43
|
+
- 'app/services/riiif/imagemagick_command_factory.rb'
|
44
|
+
- 'app/services/riiif/kakadu_command_factory.rb'
|
45
|
+
- 'app/services/riiif/resize.rb'
|
46
|
+
- 'app/transformers/riiif/kakadu_transformer.rb'
|
47
|
+
|
48
|
+
# Offense count: 1
|
10
49
|
# Configuration parameters: AllowSafeAssignment.
|
11
50
|
Lint/AssignmentInCondition:
|
12
51
|
Exclude:
|
13
|
-
- 'app/models/riiif/file.rb'
|
14
52
|
- 'app/resolvers/riiif/http_file_resolver.rb'
|
15
53
|
|
16
54
|
# Offense count: 1
|
@@ -18,27 +56,26 @@ Lint/DuplicateMethods:
|
|
18
56
|
Exclude:
|
19
57
|
- 'app/resolvers/riiif/http_file_resolver.rb'
|
20
58
|
|
21
|
-
# Offense count:
|
22
|
-
|
59
|
+
# Offense count: 2
|
60
|
+
# Configuration parameters: AllowComments.
|
61
|
+
Lint/SuppressedException:
|
23
62
|
Exclude:
|
63
|
+
- 'app/controllers/riiif/images_controller.rb'
|
24
64
|
- 'spec/models/riiif/http_file_resolver_spec.rb'
|
25
65
|
|
26
|
-
# Offense count: 1
|
27
|
-
Lint/UselessAssignment:
|
28
|
-
Exclude:
|
29
|
-
- 'app/models/riiif/file.rb'
|
30
|
-
|
31
66
|
# Offense count: 21
|
32
67
|
# Configuration parameters: CountComments, ExcludedMethods.
|
68
|
+
# ExcludedMethods: refine
|
33
69
|
Metrics/BlockLength:
|
34
|
-
Max:
|
70
|
+
Max: 237
|
35
71
|
|
36
72
|
# Offense count: 1
|
73
|
+
# Configuration parameters: IgnoredMethods.
|
37
74
|
Metrics/CyclomaticComplexity:
|
38
75
|
Max: 7
|
39
76
|
|
40
77
|
# Offense count: 3
|
41
|
-
# Configuration parameters: CountComments.
|
78
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
42
79
|
Metrics/MethodLength:
|
43
80
|
Max: 18
|
44
81
|
|
@@ -47,12 +84,20 @@ Metrics/MethodLength:
|
|
47
84
|
Metrics/ParameterLists:
|
48
85
|
Max: 6
|
49
86
|
|
87
|
+
# Offense count: 3
|
88
|
+
# Cop supports --auto-correct.
|
89
|
+
Performance/RegexpMatch:
|
90
|
+
Exclude:
|
91
|
+
- 'app/resolvers/riiif/file_system_file_resolver.rb'
|
92
|
+
- 'app/services/riiif/imagemagick_command_factory.rb'
|
93
|
+
|
50
94
|
# Offense count: 1
|
51
95
|
RSpec/DescribeClass:
|
52
96
|
Exclude:
|
53
97
|
- 'spec/routing/resize_routes_spec.rb'
|
54
98
|
|
55
99
|
# Offense count: 2
|
100
|
+
# Cop supports --auto-correct.
|
56
101
|
# Configuration parameters: SkipBlocks, EnforcedStyle.
|
57
102
|
# SupportedStyles: described_class, explicit
|
58
103
|
RSpec/DescribedClass:
|
@@ -67,9 +112,11 @@ RSpec/ExampleLength:
|
|
67
112
|
- 'spec/models/riiif/http_file_resolver_spec.rb'
|
68
113
|
- 'spec/transformers/riiif/kakadu_transformer_spec.rb'
|
69
114
|
|
70
|
-
# Offense count:
|
115
|
+
# Offense count: 2
|
116
|
+
# Cop supports --auto-correct.
|
71
117
|
RSpec/LeadingSubject:
|
72
118
|
Exclude:
|
119
|
+
- 'spec/controllers/riiif/images_controller_spec.rb'
|
73
120
|
- 'spec/transformers/riiif/kakadu_transformer_spec.rb'
|
74
121
|
|
75
122
|
# Offense count: 43
|
@@ -78,7 +125,8 @@ RSpec/LeadingSubject:
|
|
78
125
|
RSpec/MessageSpies:
|
79
126
|
EnforcedStyle: receive
|
80
127
|
|
81
|
-
# Offense count:
|
128
|
+
# Offense count: 24
|
129
|
+
# Configuration parameters: IgnoreSharedExamples.
|
82
130
|
RSpec/NamedSubject:
|
83
131
|
Exclude:
|
84
132
|
- 'spec/controllers/riiif/images_controller_spec.rb'
|
@@ -93,18 +141,51 @@ RSpec/RepeatedExample:
|
|
93
141
|
- 'spec/controllers/riiif/images_controller_spec.rb'
|
94
142
|
|
95
143
|
# Offense count: 7
|
96
|
-
# Configuration parameters: IgnoreSymbolicNames.
|
144
|
+
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
97
145
|
RSpec/VerifiedDoubles:
|
98
146
|
Exclude:
|
99
147
|
- 'spec/controllers/riiif/images_controller_spec.rb'
|
100
148
|
- 'spec/services/riiif/imagemagick_command_factory_spec.rb'
|
101
149
|
- 'spec/services/riiif/kakadu_command_factory_spec.rb'
|
102
150
|
|
151
|
+
# Offense count: 2
|
152
|
+
# Cop supports --auto-correct.
|
153
|
+
# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent.
|
154
|
+
Rails/Blank:
|
155
|
+
Exclude:
|
156
|
+
- 'spec/controllers/riiif/images_controller_spec.rb'
|
157
|
+
|
103
158
|
# Offense count: 1
|
159
|
+
# Configuration parameters: EnforcedStyle.
|
160
|
+
# SupportedStyles: slashes, arguments
|
104
161
|
Rails/FilePath:
|
105
162
|
Exclude:
|
106
163
|
- 'spec/models/riiif/akubra_system_file_resolver_spec.rb'
|
107
164
|
|
165
|
+
# Offense count: 37
|
166
|
+
# Cop supports --auto-correct.
|
167
|
+
# Configuration parameters: EnforcedStyle.
|
168
|
+
# SupportedStyles: always, always_true, never
|
169
|
+
Style/FrozenStringLiteralComment:
|
170
|
+
Enabled: false
|
171
|
+
|
172
|
+
# Offense count: 2
|
173
|
+
# Cop supports --auto-correct.
|
174
|
+
# Configuration parameters: EnforcedStyle.
|
175
|
+
# SupportedStyles: literals, strict
|
176
|
+
Style/MutableConstant:
|
177
|
+
Exclude:
|
178
|
+
- 'lib/riiif/routes.rb'
|
179
|
+
|
180
|
+
# Offense count: 1
|
181
|
+
# Cop supports --auto-correct.
|
182
|
+
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
|
183
|
+
# SupportedStyles: predicate, comparison
|
184
|
+
Style/NumericPredicate:
|
185
|
+
Exclude:
|
186
|
+
- 'spec/**/*'
|
187
|
+
- 'app/services/riiif/imagemagick_command_factory.rb'
|
188
|
+
|
108
189
|
# Offense count: 4
|
109
190
|
# Cop supports --auto-correct.
|
110
191
|
# Configuration parameters: PreferredDelimiters.
|
@@ -114,3 +195,15 @@ Style/PercentLiteralDelimiters:
|
|
114
195
|
- 'app/resolvers/riiif/file_system_file_resolver.rb'
|
115
196
|
- 'spec/controllers/riiif/images_controller_spec.rb'
|
116
197
|
- 'spec/models/riiif/http_file_resolver_spec.rb'
|
198
|
+
|
199
|
+
# Offense count: 1
|
200
|
+
# Cop supports --auto-correct.
|
201
|
+
Style/RedundantBegin:
|
202
|
+
Exclude:
|
203
|
+
- 'app/resolvers/riiif/http_file_resolver.rb'
|
204
|
+
|
205
|
+
# Offense count: 1
|
206
|
+
# Cop supports --auto-correct.
|
207
|
+
Style/RedundantFreeze:
|
208
|
+
Exclude:
|
209
|
+
- 'app/services/riiif/imagemagick_command_factory.rb'
|
data/README.md
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
# Riiif
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/riiif.png)](http://badge.fury.io/rb/riiif)
|
3
|
-
[![Coverage Status](https://coveralls.io/repos/github/curationexperts/riiif/badge.svg?branch=master)](https://coveralls.io/github/curationexperts/riiif?branch=master)
|
4
3
|
|
5
|
-
|
6
|
-
A Ruby IIIF image server as a rails engine. Note that RIIIF is meant for development convenience and will not scale to the needs of most production-level applications.
|
4
|
+
A Ruby IIIF image server as a rails engine.
|
7
5
|
|
8
6
|
## Installation
|
9
7
|
|
data/app/models/riiif/image.rb
CHANGED
@@ -33,9 +33,6 @@ module Riiif
|
|
33
33
|
@file ||= file_resolver.find(id)
|
34
34
|
end
|
35
35
|
|
36
|
-
alias image file
|
37
|
-
deprecation_deprecate image: 'Use Image#file instead. This will be removed in riiif 2.0'
|
38
|
-
|
39
36
|
##
|
40
37
|
# @param [ActiveSupport::HashWithIndifferentAccess] args
|
41
38
|
# @return [String] the image data
|
@@ -14,7 +14,7 @@ module Riiif
|
|
14
14
|
|
15
15
|
# @return [Boolean] true if the id matches the regex
|
16
16
|
def validate_identifier(id:, regex: identifier_regex)
|
17
|
-
return true if id =~ regex
|
17
|
+
return true if id.to_s =~ regex
|
18
18
|
Rails.logger.warn "Invalid characters in id `#{id}`"
|
19
19
|
false
|
20
20
|
end
|
@@ -63,7 +63,7 @@ module Riiif
|
|
63
63
|
benchmark("Riiif downloaded #{url}") do
|
64
64
|
::File.atomic_write(file_name, cache_path) do |local|
|
65
65
|
begin
|
66
|
-
|
66
|
+
handler.open(url, **download_opts) do |remote|
|
67
67
|
while chunk = remote.read(8192)
|
68
68
|
local.write(chunk)
|
69
69
|
end
|
@@ -85,6 +85,14 @@ module Riiif
|
|
85
85
|
def ensure_cache_path(path)
|
86
86
|
FileUtils.makedirs(path) unless ::File.exist?(path)
|
87
87
|
end
|
88
|
+
|
89
|
+
def handler
|
90
|
+
if url.match?(URI.regexp)
|
91
|
+
URI
|
92
|
+
else
|
93
|
+
Kernel
|
94
|
+
end
|
95
|
+
end
|
88
96
|
end
|
89
97
|
|
90
98
|
protected
|
data/lib/riiif/version.rb
CHANGED
data/riiif.gemspec
CHANGED
@@ -7,10 +7,10 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = 'riiif'
|
8
8
|
spec.version = Riiif::VERSION
|
9
9
|
spec.authors = ['Justin Coyne']
|
10
|
-
spec.email = ['
|
10
|
+
spec.email = ['jcoyne85@stanford.edu']
|
11
11
|
spec.description = 'A IIIF image server'
|
12
|
-
spec.summary = 'A
|
13
|
-
spec.homepage = 'https://github.com/
|
12
|
+
spec.summary = 'A Rails engine that support IIIF requests'
|
13
|
+
spec.homepage = 'https://github.com/sul-dlss/riiif'
|
14
14
|
spec.license = 'APACHE2'
|
15
15
|
|
16
16
|
spec.files = `git ls-files|grep -v spec/samples`.split($INPUT_RECORD_SEPARATOR)
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_dependency 'railties', '>= 4.2', '<
|
21
|
+
spec.add_dependency 'railties', '>= 4.2', '<8'
|
22
22
|
spec.add_dependency 'deprecation', '>= 1.0.0'
|
23
23
|
spec.add_dependency 'iiif-image-api', '>= 0.1.0'
|
24
24
|
|
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency 'engine_cart', '~> 2.0'
|
28
28
|
spec.add_development_dependency 'rspec-rails'
|
29
29
|
spec.add_development_dependency 'sqlite3'
|
30
|
-
spec.add_development_dependency 'bixby', '~>
|
31
|
-
spec.add_development_dependency '
|
30
|
+
spec.add_development_dependency 'bixby', '~> 5.0'
|
31
|
+
spec.add_development_dependency 'simplecov'
|
32
32
|
end
|
@@ -24,9 +24,9 @@ RSpec.describe Riiif::ImagesController do
|
|
24
24
|
it 'sends images to the service' do
|
25
25
|
image = double
|
26
26
|
expect(Riiif::Image).to receive(:new).with('abcd1234').and_return(image)
|
27
|
-
expect(image).to receive(:render).with('region' => 'full', 'size' => 'full',
|
27
|
+
expect(image).to receive(:render).with({ 'region' => 'full', 'size' => 'full',
|
28
28
|
'rotation' => '0', 'quality' => 'default',
|
29
|
-
'format' => 'jpg').and_return('IMAGEDATA')
|
29
|
+
'format' => 'jpg' }).and_return('IMAGEDATA')
|
30
30
|
get :show, params: { id: 'abcd1234', action: 'show', region: 'full', size: 'full',
|
31
31
|
rotation: '0', quality: 'default', format: 'jpg' }
|
32
32
|
expect(response).to be_successful
|
@@ -102,9 +102,9 @@ RSpec.describe Riiif::ImagesController do
|
|
102
102
|
raise Riiif::ImageNotFoundError unless file.present?
|
103
103
|
not_found_image
|
104
104
|
end.twice
|
105
|
-
expect(not_found_image).to receive(:render).with('region' => 'full', 'size' => 'full',
|
105
|
+
expect(not_found_image).to receive(:render).with({ 'region' => 'full', 'size' => 'full',
|
106
106
|
'rotation' => '0', 'quality' => 'default',
|
107
|
-
'format' => 'jpg').and_return('default-image-data')
|
107
|
+
'format' => 'jpg' }).and_return('default-image-data')
|
108
108
|
|
109
109
|
get :show, params: { id: 'bad_id', action: 'show', region: 'full', size: 'full',
|
110
110
|
rotation: '0', quality: 'default', format: 'jpg' }
|
@@ -118,9 +118,9 @@ RSpec.describe Riiif::ImagesController do
|
|
118
118
|
raise Riiif::ImageNotFoundError unless file.present?
|
119
119
|
not_found_image
|
120
120
|
end.twice
|
121
|
-
expect(not_found_image).to receive(:render).with('region' => 'full', 'size' => 'full',
|
121
|
+
expect(not_found_image).to receive(:render).with({ 'region' => 'full', 'size' => 'full',
|
122
122
|
'rotation' => '0', 'quality' => 'default',
|
123
|
-
'format' => 'jpg').and_return('default-image-data')
|
123
|
+
'format' => 'jpg' }).and_return('default-image-data')
|
124
124
|
|
125
125
|
get :show, params: { id: 'bad_id', action: 'show', region: 'full', size: 'full',
|
126
126
|
rotation: '0', quality: 'default', format: 'jpg' }
|
@@ -155,7 +155,7 @@ RSpec.describe Riiif::ImagesController do
|
|
155
155
|
get :info, params: { id: 'abcd1234', format: 'json' }
|
156
156
|
expect(response).to be_successful
|
157
157
|
expect(json).to eq '@context' => 'http://iiif.io/api/image/2/context.json',
|
158
|
-
'@id' => 'http://test.host/abcd1234',
|
158
|
+
'@id' => Rails.version > '6.1' ? 'http://test.host/images/abcd1234' : 'http://test.host/abcd1234',
|
159
159
|
'width' => 6000,
|
160
160
|
'height' => 4000,
|
161
161
|
'format' => 'JPEG',
|
@@ -78,5 +78,12 @@ describe Riiif::FileSystemFileResolver do
|
|
78
78
|
expect(subject).to be_nil
|
79
79
|
end
|
80
80
|
end
|
81
|
+
|
82
|
+
context 'as an integer' do
|
83
|
+
let(:id) { 1 }
|
84
|
+
it 'converts it to a string before parsing' do
|
85
|
+
expect { subject }.not_to raise_error
|
86
|
+
end
|
87
|
+
end
|
81
88
|
end
|
82
89
|
end
|
@@ -28,6 +28,9 @@ RSpec.describe Riiif::Image do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'is able to override the file used for the Image' do
|
31
|
+
allow(Riiif::CommandRunner).to receive(:execute)
|
32
|
+
.with("identify -format '%h %w %m %[channels]' #{filename}[0]").and_return('400 800')
|
33
|
+
|
31
34
|
img = described_class.new('some_id', Riiif::File.new(filename))
|
32
35
|
expect(img.id).to eq 'some_id'
|
33
36
|
expect(img.info).to eq Riiif::ImageInformation.new(width: 800, height: 400)
|
@@ -35,6 +38,9 @@ RSpec.describe Riiif::Image do
|
|
35
38
|
|
36
39
|
describe 'info' do
|
37
40
|
it 'returns the data' do
|
41
|
+
allow(Riiif::CommandRunner).to receive(:execute)
|
42
|
+
.with("identify -format '%h %w %m %[channels]' #{filename}[0]").and_return('400 800')
|
43
|
+
|
38
44
|
expect(subject.info).to eq Riiif::ImageInformation.new(width: 800, height: 400)
|
39
45
|
end
|
40
46
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riiif
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '4.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '8'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '4.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '8'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: deprecation
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,16 +134,16 @@ dependencies:
|
|
134
134
|
requirements:
|
135
135
|
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version:
|
137
|
+
version: '5.0'
|
138
138
|
type: :development
|
139
139
|
prerelease: false
|
140
140
|
version_requirements: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
142
|
- - "~>"
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version:
|
144
|
+
version: '5.0'
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
|
-
name:
|
146
|
+
name: simplecov
|
147
147
|
requirement: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
149
|
- - ">="
|
@@ -158,16 +158,16 @@ dependencies:
|
|
158
158
|
version: '0'
|
159
159
|
description: A IIIF image server
|
160
160
|
email:
|
161
|
-
-
|
161
|
+
- jcoyne85@stanford.edu
|
162
162
|
executables: []
|
163
163
|
extensions: []
|
164
164
|
extra_rdoc_files: []
|
165
165
|
files:
|
166
|
+
- ".github/workflows/ruby.yml"
|
166
167
|
- ".gitignore"
|
167
168
|
- ".rspec"
|
168
169
|
- ".rubocop.yml"
|
169
170
|
- ".rubocop_todo.yml"
|
170
|
-
- ".travis.yml"
|
171
171
|
- CHANGELOG
|
172
172
|
- Gemfile
|
173
173
|
- LICENSE
|
@@ -214,11 +214,11 @@ files:
|
|
214
214
|
- spec/test_app_templates/Gemfile.extra
|
215
215
|
- spec/test_app_templates/lib/generators/test_app_generator.rb
|
216
216
|
- spec/transformers/riiif/kakadu_transformer_spec.rb
|
217
|
-
homepage: https://github.com/
|
217
|
+
homepage: https://github.com/sul-dlss/riiif
|
218
218
|
licenses:
|
219
219
|
- APACHE2
|
220
220
|
metadata: {}
|
221
|
-
post_install_message:
|
221
|
+
post_install_message:
|
222
222
|
rdoc_options: []
|
223
223
|
require_paths:
|
224
224
|
- lib
|
@@ -233,10 +233,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
233
233
|
- !ruby/object:Gem::Version
|
234
234
|
version: '0'
|
235
235
|
requirements: []
|
236
|
-
rubygems_version: 3.
|
237
|
-
signing_key:
|
236
|
+
rubygems_version: 3.4.20
|
237
|
+
signing_key:
|
238
238
|
specification_version: 4
|
239
|
-
summary: A
|
239
|
+
summary: A Rails engine that support IIIF requests
|
240
240
|
test_files:
|
241
241
|
- spec/controllers/riiif/images_controller_spec.rb
|
242
242
|
- spec/models/riiif/akubra_system_file_resolver_spec.rb
|