resizing 1.3.1 → 1.4.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/.devcontainer/compose.yaml +7 -4
- data/.github/dependabot.yml +23 -0
- data/.github/tools/actionlint/Dockerfile +3 -0
- data/.github/tools/gitleaks/Dockerfile +2 -0
- data/.github/workflows/actionlint.yml +27 -0
- data/.github/workflows/actions.lock +54 -0
- data/.github/workflows/labeler.yml +3 -1
- data/.github/workflows/lint.yml +2 -2
- data/.github/workflows/secret-scan.yml +29 -0
- data/.github/workflows/test.yml +37 -6
- data/.github/workflows/verify-lockfile.yml +28 -0
- data/CLAUDE.md +2 -2
- data/Gemfile +3 -0
- data/README.ja.md +241 -0
- data/README.md +83 -1
- data/docker-compose.yml +7 -0
- data/git-hooks/pre-push-ruby.sh +16 -11
- data/lib/resizing/carrier_wave/storage/file.rb +21 -2
- data/lib/resizing/carrier_wave/storage/remote.rb +18 -13
- data/lib/resizing/carrier_wave.rb +75 -7
- data/lib/resizing/client.rb +47 -3
- data/lib/resizing/mock_client.rb +25 -2
- data/lib/resizing/version.rb +1 -1
- data/lib/resizing.rb +4 -0
- data/test/rails_app/app/views/users/new.html.erb +6 -0
- data/test/rails_app/rails_app.rb +86 -0
- data/test/resizing/carrier_wave/storage/file_test.rb +40 -0
- data/test/resizing/carrier_wave/storage/remote_test.rb +66 -9
- data/test/resizing/carrier_wave_rails_integration_test.rb +94 -0
- data/test/resizing/carrier_wave_temporary_image_test.rb +280 -0
- data/test/resizing/carrier_wave_test.rb +15 -6
- data/test/resizing/carrier_wave_uploader_test.rb +14 -0
- data/test/resizing/client_test.rb +99 -9
- data/test/resizing/mock_client_test.rb +34 -0
- data/test/resizing_module_test.rb +16 -0
- data/test/test_helper.rb +23 -2
- data/test/vcr/carrier_wave_test/confirm.yml +23 -0
- data/test/vcr/carrier_wave_test/retrieve_from_cache.yml +23 -0
- data/test/vcr/carrier_wave_test/save.yml +1 -1
- data/test/vcr/carrier_wave_test/update_image.yml +42 -2
- metadata +16 -2
|
@@ -90,7 +90,8 @@ module Resizing
|
|
|
90
90
|
VCR.use_cassette 'client/put', record: :once do
|
|
91
91
|
f = File.open('test/data/images/sample1.jpg', 'r')
|
|
92
92
|
name = 'AWEaewfAreaweFAFASfwe'
|
|
93
|
-
r =
|
|
93
|
+
r = nil
|
|
94
|
+
capture_io { r = client.put(name, f, content_type: 'image/jpeg') }
|
|
94
95
|
assert_equal(r['id'], name)
|
|
95
96
|
assert_equal(r['project_id'], Resizing.configure.project_id)
|
|
96
97
|
assert_equal(r['content_type'], 'image/jpeg')
|
|
@@ -112,8 +113,10 @@ module Resizing
|
|
|
112
113
|
name = 'AWEaewfAreaweFAFASfwe'
|
|
113
114
|
f = File.open('test/data/images/sample1.jpg', 'r')
|
|
114
115
|
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
capture_io do
|
|
117
|
+
assert_raises Resizing::APIError do
|
|
118
|
+
_r = client.put(name, f, content_type: 'image/jpeg')
|
|
119
|
+
end
|
|
117
120
|
end
|
|
118
121
|
end
|
|
119
122
|
|
|
@@ -223,8 +226,10 @@ module Resizing
|
|
|
223
226
|
Resizing.configure = configuration_template
|
|
224
227
|
client = Resizing::Client.new
|
|
225
228
|
|
|
226
|
-
|
|
227
|
-
|
|
229
|
+
capture_io do
|
|
230
|
+
assert_raises ArgumentError do
|
|
231
|
+
client.put('image_id', 'test/data/images/sample1.jpg', {})
|
|
232
|
+
end
|
|
228
233
|
end
|
|
229
234
|
end
|
|
230
235
|
|
|
@@ -304,6 +309,68 @@ module Resizing
|
|
|
304
309
|
end
|
|
305
310
|
end
|
|
306
311
|
|
|
312
|
+
def test_post_does_not_send_temporary_params_by_default
|
|
313
|
+
client, fake = client_with_fake_http
|
|
314
|
+
|
|
315
|
+
client.post(sample_path, content_type: 'image/jpeg')
|
|
316
|
+
|
|
317
|
+
assert_equal %i[image], fake.last_request[:params].keys
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
def test_post_sends_temporary_param
|
|
321
|
+
client, fake = client_with_fake_http
|
|
322
|
+
|
|
323
|
+
client.post(sample_path, content_type: 'image/jpeg', temporary: true)
|
|
324
|
+
|
|
325
|
+
params = fake.last_request[:params]
|
|
326
|
+
assert_equal 'true', params[:temporary]
|
|
327
|
+
refute params.key?(:expires_in)
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
def test_post_sends_expires_in_param_in_seconds
|
|
331
|
+
client, fake = client_with_fake_http
|
|
332
|
+
|
|
333
|
+
client.post(sample_path, content_type: 'image/jpeg', temporary: true, expires_in: 2.hours)
|
|
334
|
+
|
|
335
|
+
assert_equal '7200', fake.last_request[:params][:expires_in]
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
def test_post_ignores_expires_in_without_temporary
|
|
339
|
+
client, fake = client_with_fake_http
|
|
340
|
+
|
|
341
|
+
client.post(sample_path, content_type: 'image/jpeg', temporary: false, expires_in: 3600)
|
|
342
|
+
|
|
343
|
+
assert_equal %i[image], fake.last_request[:params].keys
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
def test_confirm_sends_put_request_to_confirm_url_with_auth_header
|
|
347
|
+
client, fake = client_with_fake_http(body: '{"id":"img-1","temporary":false,"expires_at":null}')
|
|
348
|
+
|
|
349
|
+
result = client.confirm('img-1')
|
|
350
|
+
|
|
351
|
+
request = fake.last_request
|
|
352
|
+
assert_equal :put, request[:method]
|
|
353
|
+
assert_equal "#{base_url}/img-1/confirm", request[:url]
|
|
354
|
+
assert_nil request[:params]
|
|
355
|
+
assert_match(/\Av1,\d+,[0-9a-f]{64}\z/, request[:headers]['X-ResizingToken'])
|
|
356
|
+
assert_equal({ 'id' => 'img-1', 'temporary' => false, 'expires_at' => nil }, result)
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
def test_confirm_raises_api_error_on_not_found
|
|
360
|
+
# 存在しない・期限切れ・削除済みの画像は確定できない
|
|
361
|
+
client, = client_with_fake_http(status: 404, body: not_found_body('img-1'))
|
|
362
|
+
|
|
363
|
+
error = assert_raises(Resizing::APIError) { client.confirm('img-1') }
|
|
364
|
+
|
|
365
|
+
assert_equal 'ActiveRecord::RecordNotFound', error.decoded_body['error']
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
def test_confirm_raises_api_error_when_response_is_nil
|
|
369
|
+
client, = client_with_fake_http(respond_with_nil: true)
|
|
370
|
+
|
|
371
|
+
assert_raises(Resizing::APIError) { client.confirm('img-1') }
|
|
372
|
+
end
|
|
373
|
+
|
|
307
374
|
def test_post_uses_filename_option_over_path_basename
|
|
308
375
|
client, fake = client_with_fake_http
|
|
309
376
|
|
|
@@ -364,7 +431,8 @@ module Resizing
|
|
|
364
431
|
def test_put_sends_multipart_image_to_image_url_with_auth_header
|
|
365
432
|
client, fake = client_with_fake_http(body: '{"id":"img-1"}')
|
|
366
433
|
|
|
367
|
-
result =
|
|
434
|
+
result = nil
|
|
435
|
+
capture_io { result = client.put('img-1', sample_path, content_type: 'image/jpeg') }
|
|
368
436
|
|
|
369
437
|
request = fake.last_request
|
|
370
438
|
assert_equal :put, request[:method]
|
|
@@ -380,7 +448,10 @@ module Resizing
|
|
|
380
448
|
def test_put_raises_api_error_on_error_status
|
|
381
449
|
client, = client_with_fake_http(status: 403, body: forbidden_body)
|
|
382
450
|
|
|
383
|
-
error =
|
|
451
|
+
error = nil
|
|
452
|
+
capture_io do
|
|
453
|
+
error = assert_raises(Resizing::APIError) { client.put('img-1', sample_path, content_type: 'image/jpeg') }
|
|
454
|
+
end
|
|
384
455
|
assert_equal 'invalid token is found', error.message
|
|
385
456
|
end
|
|
386
457
|
|
|
@@ -388,11 +459,21 @@ module Resizing
|
|
|
388
459
|
Resizing.configure = configuration_template
|
|
389
460
|
client = Resizing::Client.new
|
|
390
461
|
|
|
391
|
-
|
|
392
|
-
|
|
462
|
+
capture_io do
|
|
463
|
+
assert_raises ArgumentError do
|
|
464
|
+
client.put('image_id', 12_345, content_type: 'image/jpeg')
|
|
465
|
+
end
|
|
393
466
|
end
|
|
394
467
|
end
|
|
395
468
|
|
|
469
|
+
def test_put_warns_deprecation
|
|
470
|
+
client, = client_with_fake_http(body: '{"id":"img-1"}')
|
|
471
|
+
|
|
472
|
+
_out, err = capture_io { client.put('img-1', sample_path, content_type: 'image/jpeg') }
|
|
473
|
+
|
|
474
|
+
assert_includes err, Resizing::Client::DEPRECATED_PUT_MESSAGE
|
|
475
|
+
end
|
|
476
|
+
|
|
396
477
|
def test_delete_sends_delete_request_to_image_url_with_auth_header
|
|
397
478
|
client, fake = client_with_fake_http(body: '{"id":"img-1"}')
|
|
398
479
|
|
|
@@ -499,6 +580,15 @@ module Resizing
|
|
|
499
580
|
end
|
|
500
581
|
end
|
|
501
582
|
|
|
583
|
+
def test_is_timeout_with_confirm_method
|
|
584
|
+
Resizing.configure = configuration_template.merge(project_id: 'timeout_project_id')
|
|
585
|
+
|
|
586
|
+
client = Resizing::Client.new
|
|
587
|
+
assert_raises Resizing::APIError do
|
|
588
|
+
client.confirm('img-1')
|
|
589
|
+
end
|
|
590
|
+
end
|
|
591
|
+
|
|
502
592
|
def test_is_timeout_with_metadata_method
|
|
503
593
|
Resizing.configure = configuration_template.merge(project_id: 'timeout_project_id')
|
|
504
594
|
client = Resizing::Client.new
|
|
@@ -24,6 +24,40 @@ module Resizing
|
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
def test_post_returns_confirmed_image_by_default
|
|
28
|
+
result = @client.post(nil)
|
|
29
|
+
|
|
30
|
+
assert_equal false, result['temporary']
|
|
31
|
+
assert_nil result['expires_at']
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def test_post_returns_temporary_image_with_default_expiry
|
|
35
|
+
Timecop.freeze(Time.utc(2026, 1, 1, 0, 0, 0)) do
|
|
36
|
+
result = @client.post(nil, temporary: true)
|
|
37
|
+
|
|
38
|
+
assert_equal true, result['temporary']
|
|
39
|
+
assert_equal '2026-01-02T00:00:00.000Z', result['expires_at']
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def test_post_returns_temporary_image_with_given_expiry
|
|
44
|
+
Timecop.freeze(Time.utc(2026, 1, 1, 0, 0, 0)) do
|
|
45
|
+
result = @client.post(nil, temporary: true, expires_in: 3600)
|
|
46
|
+
|
|
47
|
+
assert_equal '2026-01-01T01:00:00.000Z', result['expires_at']
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def test_confirm_returns_confirmed_image_with_given_name
|
|
52
|
+
name = 'test-image-123'
|
|
53
|
+
result = @client.confirm(name)
|
|
54
|
+
|
|
55
|
+
assert_equal name, result['id']
|
|
56
|
+
assert_equal name, Resizing::PublicId.new(result['public_id']).image_id
|
|
57
|
+
assert_equal false, result['temporary']
|
|
58
|
+
assert_nil result['expires_at']
|
|
59
|
+
end
|
|
60
|
+
|
|
27
61
|
def test_put_returns_parsed_json_with_modified_name
|
|
28
62
|
VCR.use_cassette('client/put', record: :none) do
|
|
29
63
|
name = 'test-image-123'
|
|
@@ -190,6 +190,21 @@ class ResizingModuleTest < Minitest::Test
|
|
|
190
190
|
assert_equal 'image_id', result['id']
|
|
191
191
|
end
|
|
192
192
|
|
|
193
|
+
def test_confirm_delegates_to_client
|
|
194
|
+
Resizing.configure = {
|
|
195
|
+
image_host: 'https://img.example.com',
|
|
196
|
+
project_id: 'project123',
|
|
197
|
+
secret_token: 'token123',
|
|
198
|
+
enable_mock: true
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
result = Resizing.confirm('image_id')
|
|
202
|
+
|
|
203
|
+
assert_instance_of Hash, result
|
|
204
|
+
assert_equal 'image_id', result['id']
|
|
205
|
+
assert_equal false, result['temporary']
|
|
206
|
+
end
|
|
207
|
+
|
|
193
208
|
def test_metadata_delegates_to_client
|
|
194
209
|
Resizing.configure = {
|
|
195
210
|
image_host: 'https://img.example.com',
|
|
@@ -226,6 +241,7 @@ class ResizingModuleTest < Minitest::Test
|
|
|
226
241
|
assert_raises(Resizing::ConfigurationError) { Resizing.post('dummy', content_type: 'image/jpeg') }
|
|
227
242
|
assert_raises(Resizing::ConfigurationError) { Resizing.put('id', 'dummy', content_type: 'image/jpeg') }
|
|
228
243
|
assert_raises(Resizing::ConfigurationError) { Resizing.delete('id') }
|
|
244
|
+
assert_raises(Resizing::ConfigurationError) { Resizing.confirm('id') }
|
|
229
245
|
assert_raises(Resizing::ConfigurationError) { Resizing.metadata('id', {}) }
|
|
230
246
|
assert_raises(Resizing::ConfigurationError) { Resizing.url_from_image_id('id') }
|
|
231
247
|
assert_raises(Resizing::ConfigurationError) { Resizing.generate_identifier }
|
data/test/test_helper.rb
CHANGED
|
@@ -56,19 +56,25 @@ VCR.configure do |c|
|
|
|
56
56
|
end
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
-
# Resizing::Client の代わりに使う偽クライアント (delete の応答を固定し、呼び出しを記録する)
|
|
59
|
+
# Resizing::Client の代わりに使う偽クライアント (delete / confirm の応答を固定し、呼び出しを記録する)
|
|
60
60
|
class FakeApiClient
|
|
61
|
-
attr_reader :deleted_ids
|
|
61
|
+
attr_reader :deleted_ids, :confirmed_ids
|
|
62
62
|
|
|
63
63
|
def initialize(response)
|
|
64
64
|
@response = response
|
|
65
65
|
@deleted_ids = []
|
|
66
|
+
@confirmed_ids = []
|
|
66
67
|
end
|
|
67
68
|
|
|
68
69
|
def delete(image_id)
|
|
69
70
|
@deleted_ids << image_id
|
|
70
71
|
@response.dup
|
|
71
72
|
end
|
|
73
|
+
|
|
74
|
+
def confirm(image_id)
|
|
75
|
+
@confirmed_ids << image_id
|
|
76
|
+
@response.dup
|
|
77
|
+
end
|
|
72
78
|
end
|
|
73
79
|
|
|
74
80
|
# Resizing::Client を FakeApiClient に差し替えるヘルパー
|
|
@@ -438,6 +444,15 @@ class ResizingUploaderWithUndefinedProcessor < CarrierWave::Uploader::Base
|
|
|
438
444
|
process convert: 'png'
|
|
439
445
|
end
|
|
440
446
|
|
|
447
|
+
# Uploader that changes the expiry of the temporary image uploaded on assignment
|
|
448
|
+
class ResizingUploaderWithCacheExpiresIn < CarrierWave::Uploader::Base
|
|
449
|
+
include Resizing::CarrierWave
|
|
450
|
+
|
|
451
|
+
def cache_expires_in
|
|
452
|
+
3600
|
|
453
|
+
end
|
|
454
|
+
end
|
|
455
|
+
|
|
441
456
|
class TestModel < ::ActiveRecord::Base
|
|
442
457
|
mount_uploader :resizing_picture, ResizingUploader
|
|
443
458
|
end
|
|
@@ -478,6 +493,12 @@ class TestModelWithUndefinedProcessor < ::ActiveRecord::Base
|
|
|
478
493
|
mount_uploader :resizing_picture, ResizingUploaderWithUndefinedProcessor
|
|
479
494
|
end
|
|
480
495
|
|
|
496
|
+
class TestModelWithCacheExpiresIn < ::ActiveRecord::Base
|
|
497
|
+
self.table_name = 'test_models'
|
|
498
|
+
|
|
499
|
+
mount_uploader :resizing_picture, ResizingUploaderWithCacheExpiresIn
|
|
500
|
+
end
|
|
501
|
+
|
|
481
502
|
class TestJPGModel < ::ActiveRecord::Base
|
|
482
503
|
mount_uploader :resizing_picture, ResizingJPGUploader
|
|
483
504
|
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: put
|
|
5
|
+
uri: http://192.168.56.101:5000/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/14ea7aac-a194-4330-931f-6b562aec413d/confirm
|
|
6
|
+
body:
|
|
7
|
+
encoding: US-ASCII
|
|
8
|
+
string: ''
|
|
9
|
+
headers:
|
|
10
|
+
User-Agent:
|
|
11
|
+
- Faraday v1.0.1
|
|
12
|
+
response:
|
|
13
|
+
status:
|
|
14
|
+
code: 200
|
|
15
|
+
message: OK
|
|
16
|
+
headers:
|
|
17
|
+
content-type:
|
|
18
|
+
- application/json; charset=utf-8
|
|
19
|
+
body:
|
|
20
|
+
encoding: UTF-8
|
|
21
|
+
string: '{"id":"14ea7aac-a194-4330-931f-6b562aec413d","project_id":"e06e710d-f026-4dcf-b2c0-eab0de8bb83f","content_type":"image/jpeg","latest_version_id":"_8c5lEhDB5RT3PZp1Fn5PYGm9YVx_x0e","latest_etag":"\"5766f95a7f28e6a53dd6fd179bf03a32\"","size":848590,"created_at":"2020-10-11T04:56:48.340Z","updated_at":"2020-10-11T04:57:10.120Z","filename":"sample1.jpg","width":4032,"height":3016,"format":"jpeg","version":"_8c5lEhDB5RT3PZp1Fn5PYGm9YVx_x0e","public_id":"/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/14ea7aac-a194-4330-931f-6b562aec413d/v_8c5lEhDB5RT3PZp1Fn5PYGm9YVx_x0e","temporary":false,"expires_at":null}'
|
|
22
|
+
recorded_at: Sun, 11 Oct 2020 04:57:10 GMT
|
|
23
|
+
recorded_with: VCR 6.0.0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: get
|
|
5
|
+
uri: http://192.168.56.101:5000/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/14ea7aac-a194-4330-931f-6b562aec413d/metadata
|
|
6
|
+
body:
|
|
7
|
+
encoding: US-ASCII
|
|
8
|
+
string: ''
|
|
9
|
+
headers:
|
|
10
|
+
User-Agent:
|
|
11
|
+
- Faraday v1.0.1
|
|
12
|
+
response:
|
|
13
|
+
status:
|
|
14
|
+
code: 200
|
|
15
|
+
message: OK
|
|
16
|
+
headers:
|
|
17
|
+
content-type:
|
|
18
|
+
- application/json; charset=utf-8
|
|
19
|
+
body:
|
|
20
|
+
encoding: UTF-8
|
|
21
|
+
string: '{"id":"14ea7aac-a194-4330-931f-6b562aec413d","project_id":"e06e710d-f026-4dcf-b2c0-eab0de8bb83f","content_type":"image/jpeg","latest_version_id":"_8c5lEhDB5RT3PZp1Fn5PYGm9YVx_x0e","latest_etag":"\"5766f95a7f28e6a53dd6fd179bf03a32\"","size":848590,"created_at":"2020-10-11T04:56:48.340Z","updated_at":"2020-10-11T04:56:48.340Z","filename":"sample1.jpg","width":4032,"height":3016,"format":"jpeg","version":"_8c5lEhDB5RT3PZp1Fn5PYGm9YVx_x0e","public_id":"/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/14ea7aac-a194-4330-931f-6b562aec413d/v_8c5lEhDB5RT3PZp1Fn5PYGm9YVx_x0e","temporary":true,"expires_at":"2020-10-12T04:56:48.340Z"}'
|
|
22
|
+
recorded_at: Sun, 11 Oct 2020 04:57:05 GMT
|
|
23
|
+
recorded_with: VCR 6.0.0
|
|
@@ -47,6 +47,6 @@ http_interactions:
|
|
|
47
47
|
- chunked
|
|
48
48
|
body:
|
|
49
49
|
encoding: UTF-8
|
|
50
|
-
string: '{"id":"14ea7aac-a194-4330-931f-6b562aec413d","project_id":"e06e710d-f026-4dcf-b2c0-eab0de8bb83f","content_type":"image/jpeg","latest_version_id":"_8c5lEhDB5RT3PZp1Fn5PYGm9YVx_x0e","latest_etag":"\"5766f95a7f28e6a53dd6fd179bf03a32\"","size":848590,"created_at":"2020-10-11T04:56:48.340Z","updated_at":"2020-10-11T04:56:48.340Z","filename":"sample1.jpg","width":4032,"height":3016,"format":"jpeg","version":"_8c5lEhDB5RT3PZp1Fn5PYGm9YVx_x0e","public_id":"/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/14ea7aac-a194-4330-931f-6b562aec413d/v_8c5lEhDB5RT3PZp1Fn5PYGm9YVx_x0e"}'
|
|
50
|
+
string: '{"id":"14ea7aac-a194-4330-931f-6b562aec413d","project_id":"e06e710d-f026-4dcf-b2c0-eab0de8bb83f","content_type":"image/jpeg","latest_version_id":"_8c5lEhDB5RT3PZp1Fn5PYGm9YVx_x0e","latest_etag":"\"5766f95a7f28e6a53dd6fd179bf03a32\"","size":848590,"created_at":"2020-10-11T04:56:48.340Z","updated_at":"2020-10-11T04:56:48.340Z","filename":"sample1.jpg","width":4032,"height":3016,"format":"jpeg","version":"_8c5lEhDB5RT3PZp1Fn5PYGm9YVx_x0e","public_id":"/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/14ea7aac-a194-4330-931f-6b562aec413d/v_8c5lEhDB5RT3PZp1Fn5PYGm9YVx_x0e","temporary":true,"expires_at":"2020-10-12T04:56:48.340Z"}'
|
|
51
51
|
recorded_at: Sun, 11 Oct 2020 04:56:48 GMT
|
|
52
52
|
recorded_with: VCR 6.0.0
|
|
@@ -18,7 +18,7 @@ http_interactions:
|
|
|
18
18
|
- application/json; charset=utf-8
|
|
19
19
|
body:
|
|
20
20
|
encoding: UTF-8
|
|
21
|
-
string: '{"id":"old-image-id-1111-1111-111111111111","project_id":"e06e710d-f026-4dcf-b2c0-eab0de8bb83f","content_type":"image/jpeg","version":"v1","public_id":"/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/old-image-id-1111-1111-111111111111/v1"}'
|
|
21
|
+
string: '{"id":"old-image-id-1111-1111-111111111111","project_id":"e06e710d-f026-4dcf-b2c0-eab0de8bb83f","content_type":"image/jpeg","version":"v1","public_id":"/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/old-image-id-1111-1111-111111111111/v1","temporary":true,"expires_at":"2020-10-12T04:56:48.000Z"}'
|
|
22
22
|
recorded_at: Sun, 11 Oct 2020 04:56:48 GMT
|
|
23
23
|
- request:
|
|
24
24
|
method: post
|
|
@@ -38,7 +38,47 @@ http_interactions:
|
|
|
38
38
|
- application/json; charset=utf-8
|
|
39
39
|
body:
|
|
40
40
|
encoding: UTF-8
|
|
41
|
-
string: '{"id":"new-image-id-2222-2222-222222222222","project_id":"e06e710d-f026-4dcf-b2c0-eab0de8bb83f","content_type":"image/jpeg","version":"v2","public_id":"/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/new-image-id-2222-2222-222222222222/v2"}'
|
|
41
|
+
string: '{"id":"new-image-id-2222-2222-222222222222","project_id":"e06e710d-f026-4dcf-b2c0-eab0de8bb83f","content_type":"image/jpeg","version":"v2","public_id":"/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/new-image-id-2222-2222-222222222222/v2","temporary":true,"expires_at":"2020-10-12T04:56:49.000Z"}'
|
|
42
|
+
recorded_at: Sun, 11 Oct 2020 04:56:49 GMT
|
|
43
|
+
- request:
|
|
44
|
+
method: put
|
|
45
|
+
uri: http://192.168.56.101:5000/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/old-image-id-1111-1111-111111111111/confirm
|
|
46
|
+
body:
|
|
47
|
+
encoding: US-ASCII
|
|
48
|
+
string: ''
|
|
49
|
+
headers:
|
|
50
|
+
User-Agent:
|
|
51
|
+
- Faraday v1.0.1
|
|
52
|
+
response:
|
|
53
|
+
status:
|
|
54
|
+
code: 200
|
|
55
|
+
message: OK
|
|
56
|
+
headers:
|
|
57
|
+
content-type:
|
|
58
|
+
- application/json; charset=utf-8
|
|
59
|
+
body:
|
|
60
|
+
encoding: UTF-8
|
|
61
|
+
string: '{"id":"old-image-id-1111-1111-111111111111","project_id":"e06e710d-f026-4dcf-b2c0-eab0de8bb83f","content_type":"image/jpeg","version":"v1","public_id":"/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/old-image-id-1111-1111-111111111111/v1","temporary":false,"expires_at":null}'
|
|
62
|
+
recorded_at: Sun, 11 Oct 2020 04:56:48 GMT
|
|
63
|
+
- request:
|
|
64
|
+
method: put
|
|
65
|
+
uri: http://192.168.56.101:5000/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/new-image-id-2222-2222-222222222222/confirm
|
|
66
|
+
body:
|
|
67
|
+
encoding: US-ASCII
|
|
68
|
+
string: ''
|
|
69
|
+
headers:
|
|
70
|
+
User-Agent:
|
|
71
|
+
- Faraday v1.0.1
|
|
72
|
+
response:
|
|
73
|
+
status:
|
|
74
|
+
code: 200
|
|
75
|
+
message: OK
|
|
76
|
+
headers:
|
|
77
|
+
content-type:
|
|
78
|
+
- application/json; charset=utf-8
|
|
79
|
+
body:
|
|
80
|
+
encoding: UTF-8
|
|
81
|
+
string: '{"id":"new-image-id-2222-2222-222222222222","project_id":"e06e710d-f026-4dcf-b2c0-eab0de8bb83f","content_type":"image/jpeg","version":"v2","public_id":"/projects/e06e710d-f026-4dcf-b2c0-eab0de8bb83f/upload/images/new-image-id-2222-2222-222222222222/v2","temporary":false,"expires_at":null}'
|
|
42
82
|
recorded_at: Sun, 11 Oct 2020 04:56:49 GMT
|
|
43
83
|
- request:
|
|
44
84
|
method: delete
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: resizing
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Junichiro Kasuya
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -197,11 +197,18 @@ files:
|
|
|
197
197
|
- ".devcontainer/devcontainer.json"
|
|
198
198
|
- ".devcontainer/post-create.sh"
|
|
199
199
|
- ".github/copilot-instructions.md"
|
|
200
|
+
- ".github/dependabot.yml"
|
|
200
201
|
- ".github/labeler.yml"
|
|
201
202
|
- ".github/release.yml"
|
|
203
|
+
- ".github/tools/actionlint/Dockerfile"
|
|
204
|
+
- ".github/tools/gitleaks/Dockerfile"
|
|
205
|
+
- ".github/workflows/actionlint.yml"
|
|
206
|
+
- ".github/workflows/actions.lock"
|
|
202
207
|
- ".github/workflows/labeler.yml"
|
|
203
208
|
- ".github/workflows/lint.yml"
|
|
209
|
+
- ".github/workflows/secret-scan.yml"
|
|
204
210
|
- ".github/workflows/test.yml"
|
|
211
|
+
- ".github/workflows/verify-lockfile.yml"
|
|
205
212
|
- ".gitignore"
|
|
206
213
|
- ".rubocop.yml"
|
|
207
214
|
- AGENTS.md
|
|
@@ -209,6 +216,7 @@ files:
|
|
|
209
216
|
- CLAUDE.md
|
|
210
217
|
- Gemfile
|
|
211
218
|
- LICENSE.txt
|
|
219
|
+
- README.ja.md
|
|
212
220
|
- README.md
|
|
213
221
|
- Rakefile
|
|
214
222
|
- bin/console
|
|
@@ -236,11 +244,15 @@ files:
|
|
|
236
244
|
- resizing.gemspec
|
|
237
245
|
- test/data/images/empty_file.jpg
|
|
238
246
|
- test/data/images/sample1.jpg
|
|
247
|
+
- test/rails_app/app/views/users/new.html.erb
|
|
248
|
+
- test/rails_app/rails_app.rb
|
|
239
249
|
- test/resizing/active_storage_service_test.rb
|
|
240
250
|
- test/resizing/carrier_wave/storage/file_test.rb
|
|
241
251
|
- test/resizing/carrier_wave/storage/remote_test.rb
|
|
242
252
|
- test/resizing/carrier_wave_cache_callbacks_test.rb
|
|
243
253
|
- test/resizing/carrier_wave_callback_file_test.rb
|
|
254
|
+
- test/resizing/carrier_wave_rails_integration_test.rb
|
|
255
|
+
- test/resizing/carrier_wave_temporary_image_test.rb
|
|
244
256
|
- test/resizing/carrier_wave_test.rb
|
|
245
257
|
- test/resizing/carrier_wave_uploader_test.rb
|
|
246
258
|
- test/resizing/client_test.rb
|
|
@@ -254,7 +266,9 @@ files:
|
|
|
254
266
|
- test/resizing_module_test.rb
|
|
255
267
|
- test/resizing_test.rb
|
|
256
268
|
- test/test_helper.rb
|
|
269
|
+
- test/vcr/carrier_wave_test/confirm.yml
|
|
257
270
|
- test/vcr/carrier_wave_test/remove_resizing_picture.yml
|
|
271
|
+
- test/vcr/carrier_wave_test/retrieve_from_cache.yml
|
|
258
272
|
- test/vcr/carrier_wave_test/save.yml
|
|
259
273
|
- test/vcr/carrier_wave_test/update_image.yml
|
|
260
274
|
- test/vcr/client/delete.yml
|