dynamic_paperclip 1.0.0.alpha.4 → 1.0.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/lib/dynamic_paperclip/attachment.rb +2 -2
- data/lib/dynamic_paperclip/attachment_style_generator.rb +12 -2
- data/lib/dynamic_paperclip/railtie.rb +2 -2
- data/lib/dynamic_paperclip/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +357 -0
- data/test/unit/attachment_style_generator_test.rb +18 -15
- metadata +26 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 532f05d2c123371561ae9a1fabdde9621994a72c
|
4
|
+
data.tar.gz: af6332a7d263cac5c5bc59cb6ba532f8fdb67e1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d410c0304dfe6fe9c195e08c72e7b9875ee091e8e194c36ffeadc025915237b32639033f5197db425ed203ff3623ce54241c8614c33f5ee267be6ad34fe3611
|
7
|
+
data.tar.gz: 4162c46ed79f90659a04fffa7c24a5754ee866ffb819d0b94213444a99de742ba08556bb35474faf928bfc3e97405e09248bae03ead968e3c78ee769dc63964d
|
@@ -42,7 +42,7 @@ module DynamicPaperclip
|
|
42
42
|
|
43
43
|
url = url(style_name)
|
44
44
|
|
45
|
-
delimiter_char = url.match(
|
45
|
+
delimiter_char = url.match(/\?/) ? '&' : '?'
|
46
46
|
|
47
47
|
"#{url}#{delimiter_char}s=#{UrlSecurity.generate_hash(style_name)}"
|
48
48
|
end
|
@@ -64,4 +64,4 @@ module DynamicPaperclip
|
|
64
64
|
@dynamic_styles[name.to_sym] = Paperclip::Style.new(name, StyleNaming.style_definition_from_dynamic_style_name(name), self)
|
65
65
|
end
|
66
66
|
end
|
67
|
-
end
|
67
|
+
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'rack/request'
|
2
|
-
|
2
|
+
|
3
|
+
require 'action_controller/metal/data_streaming' # For Rails 4
|
4
|
+
require 'action_dispatch/http/response.rb' # For Rails 5
|
3
5
|
|
4
6
|
module DynamicPaperclip
|
5
7
|
class AttachmentStyleGenerator
|
@@ -18,6 +20,11 @@ module DynamicPaperclip
|
|
18
20
|
id = id_from_partition(match[:id])
|
19
21
|
attachment = klass.find(id).send(name)
|
20
22
|
|
23
|
+
# When the filename is wrong, return a 404
|
24
|
+
if !attachment.exists? || attachment.original_filename != URI.unescape(match[:filename])
|
25
|
+
return [404, {}, []]
|
26
|
+
end
|
27
|
+
|
21
28
|
# The definition will be escaped twice in the URL, so we need to unescape it once.
|
22
29
|
# We should always reference dynamic style names after escaping once - that's how they reside on the FS.
|
23
30
|
style_name = StyleNaming.dynamic_style_name_from_definition(CGI.unescape(match[:definition]), false)
|
@@ -30,6 +37,9 @@ module DynamicPaperclip
|
|
30
37
|
# an existing style
|
31
38
|
attachment.process_dynamic_style style_name unless attachment.exists?(style_name)
|
32
39
|
|
40
|
+
# The FileBody class has been moved to another module in Rails 5
|
41
|
+
file_body = defined?(ActionController::DataStreaming::FileBody) ? ActionController::DataStreaming::FileBody : ActionDispatch::Response::FileBody
|
42
|
+
|
33
43
|
return [
|
34
44
|
200,
|
35
45
|
{
|
@@ -37,7 +47,7 @@ module DynamicPaperclip
|
|
37
47
|
'Content-Transfer-Encoding' => 'binary',
|
38
48
|
'Content-Disposition' => "inline; filename=#{File.basename(attachment.path(style_name))}"
|
39
49
|
},
|
40
|
-
|
50
|
+
file_body.new(attachment.path(style_name))
|
41
51
|
]
|
42
52
|
else
|
43
53
|
# Invalid hash, just 403
|
@@ -3,9 +3,9 @@ require 'dynamic_paperclip/attachment_style_generator'
|
|
3
3
|
module DynamicPaperclip
|
4
4
|
class Railtie < Rails::Railtie
|
5
5
|
initializer 'dynamic_paperclip.insert_middleware' do |app|
|
6
|
-
app.config.middleware.use
|
6
|
+
app.config.middleware.use DynamicPaperclip::AttachmentStyleGenerator
|
7
7
|
end
|
8
8
|
|
9
9
|
rake_tasks { load 'tasks/dynamic_paperclip.rake' }
|
10
10
|
end
|
11
|
-
end
|
11
|
+
end
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/test/dummy/log/test.log
CHANGED
@@ -5274,3 +5274,360 @@ AttachmentTest: test_: Attachment should use DynamicPaperclip::Attachment for dy
|
|
5274
5274
|
InstallGeneratorTest: test_generates_secret_and_configures_DynamicPaperclip_to_use_it
|
5275
5275
|
-------------------------------------------------------------------------------------
|
5276
5276
|
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5277
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5278
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5279
|
+
[1m[35m (2.2ms)[0m [1m[35mCREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)[0m
|
5280
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5281
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.2ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
5282
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5283
|
+
[1m[35mSQL (0.3ms)[0m [1m[32mINSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?)[0m [["key", "environment"], ["value", "test"], ["created_at", "2017-07-09 20:10:23.052416"], ["updated_at", "2017-07-09 20:10:23.052416"]]
|
5284
|
+
[1m[35m (0.6ms)[0m [1m[36mcommit transaction[0m
|
5285
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5286
|
+
--------------------------------
|
5287
|
+
DynamicPaperclipTest: test_truth
|
5288
|
+
--------------------------------
|
5289
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
5290
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5291
|
+
[1m[36mFixture Delete (0.5ms)[0m [1m[31mDELETE FROM "photos"[0m
|
5292
|
+
[1m[36mFixture Insert (0.7ms)[0m [1m[32mINSERT INTO "photos" ("id", "image_file_name", "image_content_type", "created_at", "updated_at") VALUES (1, 'rails.png', 'image/png', '2017-07-09 20:10:23.106409', '2017-07-09 20:10:23.106409')[0m
|
5293
|
+
[1m[36mFixture Insert (0.1ms)[0m [1m[32mINSERT INTO "photos" ("id", "created_at", "updated_at") VALUES (2, '2017-07-09 20:10:23.106409', '2017-07-09 20:10:23.106409')[0m
|
5294
|
+
[1m[35m (1.1ms)[0m [1m[36mcommit transaction[0m
|
5295
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5296
|
+
-----------------------------------------------------------------------------------------------
|
5297
|
+
AttachmentTest: test_: Attachment should return true from query method when attachment is set.
|
5298
|
+
-----------------------------------------------------------------------------------------------
|
5299
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5300
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5301
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5302
|
+
---------------------------------------------------------------------------------------------------------------------
|
5303
|
+
AttachmentTest: test_: Attachment should delete styles passed to #delete_styles and maintain existing delete queued.
|
5304
|
+
---------------------------------------------------------------------------------------------------------------------
|
5305
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5306
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
5307
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5308
|
+
-----------------------------------------------------------------------------------------
|
5309
|
+
AttachmentTest: test_: Attachment should only include dynamic styles in #dynamic_styles.
|
5310
|
+
-----------------------------------------------------------------------------------------
|
5311
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5312
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
5313
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5314
|
+
---------------------------------------------------------------------------------------------------------------
|
5315
|
+
AttachmentTest: test_: Attachment should generate correct secure attachment URL when given a style definition.
|
5316
|
+
---------------------------------------------------------------------------------------------------------------
|
5317
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5318
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5319
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5320
|
+
-------------------------------------------------------------------------------------
|
5321
|
+
AttachmentTest: test_: Attachment should include existing dynamic styles in #styles.
|
5322
|
+
-------------------------------------------------------------------------------------
|
5323
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5324
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
5325
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5326
|
+
----------------------------------------------------------------------------------------------------
|
5327
|
+
AttachmentTest: test_: Attachment should return false from query method when attachment is not set.
|
5328
|
+
----------------------------------------------------------------------------------------------------
|
5329
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
|
5330
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
5331
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5332
|
+
---------------------------------------------------------------------------------------------------
|
5333
|
+
AttachmentTest: test_: Attachment should use DynamicPaperclip::Attachment for dynamic attachments.
|
5334
|
+
---------------------------------------------------------------------------------------------------
|
5335
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
5336
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5337
|
+
------------------------------------------------------------------------------------------------------------------------------------------------------
|
5338
|
+
AttachmentTest: test_: Attachment should add dynamic style to #styles and reprocess it when a dynamic style name is passed to #process_dynamic_style.
|
5339
|
+
------------------------------------------------------------------------------------------------------------------------------------------------------
|
5340
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5341
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5342
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5343
|
+
---------------------------------------------------------------------------------------
|
5344
|
+
AttachmentTest: test_: Attachment should raise error if no secret has been configured.
|
5345
|
+
---------------------------------------------------------------------------------------
|
5346
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5347
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
5348
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5349
|
+
---------------------------------------------------------------------------------------------------------------------
|
5350
|
+
DynamicAttachmentStylesTest: test_: DynamicAttachmentStyles should generate dynamic style and send it to the client.
|
5351
|
+
---------------------------------------------------------------------------------------------------------------------
|
5352
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5353
|
+
Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2017-07-09 16:10:23 -0400
|
5354
|
+
[1m[36mPhoto Load (0.0ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5355
|
+
Command :: file -b --mime '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720170709-15038-1vt65ol.png'
|
5356
|
+
Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720170709-15038-vjhbqg.png[0]' 2>/dev/null
|
5357
|
+
Command :: identify -format %m '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720170709-15038-vjhbqg.png[0]'
|
5358
|
+
Command :: convert '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720170709-15038-vjhbqg.png[0]' -auto-orient -resize "100x100" '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/36e34534f477f75d2a20fca014c56f9020170709-15038-nliyjj'
|
5359
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
5360
|
+
[1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "photos" SET "image_file_size" = ?, "image_updated_at" = ?, "updated_at" = ?, "image_file_name" = ? WHERE "photos"."id" = ?[0m [["image_file_size", 6646], ["image_updated_at", "2017-07-09 20:10:23.278875"], ["updated_at", "2017-07-09 20:10:23.367904"], ["image_file_name", "rails.png"], ["id", 1]]
|
5361
|
+
[1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
5362
|
+
[1m[35m (1.0ms)[0m [1m[31mrollback transaction[0m
|
5363
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5364
|
+
-------------------------------------------------------------------------------------
|
5365
|
+
InstallGeneratorTest: test_generates_secret_and_configures_DynamicPaperclip_to_use_it
|
5366
|
+
-------------------------------------------------------------------------------------
|
5367
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5368
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5369
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5370
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5371
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.4ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
5372
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5373
|
+
[1m[35m (0.1ms)[0m [1m[36mcommit transaction[0m
|
5374
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5375
|
+
--------------------------------
|
5376
|
+
DynamicPaperclipTest: test_truth
|
5377
|
+
--------------------------------
|
5378
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
5379
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5380
|
+
[1m[36mFixture Delete (0.4ms)[0m [1m[31mDELETE FROM "photos"[0m
|
5381
|
+
[1m[36mFixture Insert (0.2ms)[0m [1m[32mINSERT INTO "photos" ("id", "image_file_name", "image_content_type", "created_at", "updated_at") VALUES (1, 'rails.png', 'image/png', '2018-11-28 17:01:43.254736', '2018-11-28 17:01:43.254736')[0m
|
5382
|
+
[1m[36mFixture Insert (0.1ms)[0m [1m[32mINSERT INTO "photos" ("id", "created_at", "updated_at") VALUES (2, '2018-11-28 17:01:43.254736', '2018-11-28 17:01:43.254736')[0m
|
5383
|
+
[1m[35m (0.9ms)[0m [1m[36mcommit transaction[0m
|
5384
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5385
|
+
---------------------------------------------------------------------------------------
|
5386
|
+
AttachmentTest: test_: Attachment should raise error if no secret has been configured.
|
5387
|
+
---------------------------------------------------------------------------------------
|
5388
|
+
[1m[36mPhoto Load (0.2ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5389
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5390
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5391
|
+
---------------------------------------------------------------------------------------------------
|
5392
|
+
AttachmentTest: test_: Attachment should use DynamicPaperclip::Attachment for dynamic attachments.
|
5393
|
+
---------------------------------------------------------------------------------------------------
|
5394
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5395
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5396
|
+
---------------------------------------------------------------------------------------------------------------------
|
5397
|
+
AttachmentTest: test_: Attachment should delete styles passed to #delete_styles and maintain existing delete queued.
|
5398
|
+
---------------------------------------------------------------------------------------------------------------------
|
5399
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5400
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5401
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5402
|
+
-----------------------------------------------------------------------------------------
|
5403
|
+
AttachmentTest: test_: Attachment should only include dynamic styles in #dynamic_styles.
|
5404
|
+
-----------------------------------------------------------------------------------------
|
5405
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5406
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5407
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5408
|
+
-------------------------------------------------------------------------------------
|
5409
|
+
AttachmentTest: test_: Attachment should include existing dynamic styles in #styles.
|
5410
|
+
-------------------------------------------------------------------------------------
|
5411
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5412
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
5413
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5414
|
+
----------------------------------------------------------------------------------------------------
|
5415
|
+
AttachmentTest: test_: Attachment should return false from query method when attachment is not set.
|
5416
|
+
----------------------------------------------------------------------------------------------------
|
5417
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
|
5418
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
5419
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5420
|
+
-----------------------------------------------------------------------------------------------
|
5421
|
+
AttachmentTest: test_: Attachment should return true from query method when attachment is set.
|
5422
|
+
-----------------------------------------------------------------------------------------------
|
5423
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5424
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5425
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5426
|
+
---------------------------------------------------------------------------------------------------------------
|
5427
|
+
AttachmentTest: test_: Attachment should generate correct secure attachment URL when given a style definition.
|
5428
|
+
---------------------------------------------------------------------------------------------------------------
|
5429
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5430
|
+
[1m[35m (0.0ms)[0m [1m[31mrollback transaction[0m
|
5431
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5432
|
+
------------------------------------------------------------------------------------------------------------------------------------------------------
|
5433
|
+
AttachmentTest: test_: Attachment should add dynamic style to #styles and reprocess it when a dynamic style name is passed to #process_dynamic_style.
|
5434
|
+
------------------------------------------------------------------------------------------------------------------------------------------------------
|
5435
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5436
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5437
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5438
|
+
---------------------------------------------------------------------------------------------------------------------
|
5439
|
+
DynamicAttachmentStylesTest: test_: DynamicAttachmentStyles should generate dynamic style and send it to the client.
|
5440
|
+
---------------------------------------------------------------------------------------------------------------------
|
5441
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5442
|
+
Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2018-11-28 12:01:43 -0500
|
5443
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5444
|
+
Command :: file -b --mime '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-62536-8njla5.png'
|
5445
|
+
Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-62536-150tusr.png[0]' 2>/dev/null
|
5446
|
+
Command :: identify -format %m '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-62536-150tusr.png[0]'
|
5447
|
+
Command :: convert '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-62536-150tusr.png[0]' -auto-orient -resize "100x100" '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/cdc0ec0084039f9f2ee2afc111bd872820181128-62536-y162l6'
|
5448
|
+
[1m[35m (0.1ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
5449
|
+
[1m[35mSQL (0.3ms)[0m [1m[33mUPDATE "photos" SET "image_file_size" = ?, "image_updated_at" = ?, "updated_at" = ?, "image_file_name" = ? WHERE "photos"."id" = ?[0m [["image_file_size", 6646], ["image_updated_at", "2018-11-28 17:01:43.462825"], ["updated_at", "2018-11-28 17:01:43.542524"], ["image_file_name", "rails.png"], ["id", 1]]
|
5450
|
+
[1m[35m (0.0ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
5451
|
+
[1m[35m (0.6ms)[0m [1m[31mrollback transaction[0m
|
5452
|
+
[1m[35m (0.0ms)[0m [1m[36mbegin transaction[0m
|
5453
|
+
-------------------------------------------------------------------------------------
|
5454
|
+
InstallGeneratorTest: test_generates_secret_and_configures_DynamicPaperclip_to_use_it
|
5455
|
+
-------------------------------------------------------------------------------------
|
5456
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5457
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5458
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5459
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1m[34mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5460
|
+
[1m[36mActiveRecord::InternalMetadata Load (0.3ms)[0m [1m[34mSELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ?[0m [["key", "environment"], ["LIMIT", 1]]
|
5461
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
5462
|
+
[1m[35m (0.1ms)[0m [1m[36mcommit transaction[0m
|
5463
|
+
[1m[35m (0.2ms)[0m [1m[36mbegin transaction[0m
|
5464
|
+
-------------------------------------------------------------------------------------
|
5465
|
+
InstallGeneratorTest: test_generates_secret_and_configures_DynamicPaperclip_to_use_it
|
5466
|
+
-------------------------------------------------------------------------------------
|
5467
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5468
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5469
|
+
--------------------------------
|
5470
|
+
DynamicPaperclipTest: test_truth
|
5471
|
+
--------------------------------
|
5472
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5473
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5474
|
+
[1m[36mFixture Delete (0.5ms)[0m [1m[31mDELETE FROM "photos"[0m
|
5475
|
+
[1m[36mFixture Insert (0.1ms)[0m [1m[32mINSERT INTO "photos" ("id", "image_file_name", "image_content_type", "created_at", "updated_at") VALUES (1, 'rails.png', 'image/png', '2018-11-28 17:02:06.431023', '2018-11-28 17:02:06.431023')[0m
|
5476
|
+
[1m[36mFixture Insert (0.1ms)[0m [1m[32mINSERT INTO "photos" ("id", "created_at", "updated_at") VALUES (2, '2018-11-28 17:02:06.431023', '2018-11-28 17:02:06.431023')[0m
|
5477
|
+
[1m[35m (1.2ms)[0m [1m[36mcommit transaction[0m
|
5478
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5479
|
+
----------------------------------------------------------------------------------------------------
|
5480
|
+
AttachmentTest: test_: Attachment should return false from query method when attachment is not set.
|
5481
|
+
----------------------------------------------------------------------------------------------------
|
5482
|
+
[1m[36mPhoto Load (0.2ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 2], ["LIMIT", 1]]
|
5483
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5484
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5485
|
+
-----------------------------------------------------------------------------------------------
|
5486
|
+
AttachmentTest: test_: Attachment should return true from query method when attachment is set.
|
5487
|
+
-----------------------------------------------------------------------------------------------
|
5488
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5489
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5490
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5491
|
+
-----------------------------------------------------------------------------------------
|
5492
|
+
AttachmentTest: test_: Attachment should only include dynamic styles in #dynamic_styles.
|
5493
|
+
-----------------------------------------------------------------------------------------
|
5494
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5495
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5496
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5497
|
+
------------------------------------------------------------------------------------------------------------------------------------------------------
|
5498
|
+
AttachmentTest: test_: Attachment should add dynamic style to #styles and reprocess it when a dynamic style name is passed to #process_dynamic_style.
|
5499
|
+
------------------------------------------------------------------------------------------------------------------------------------------------------
|
5500
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5501
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5502
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5503
|
+
---------------------------------------------------------------------------------------------------------------
|
5504
|
+
AttachmentTest: test_: Attachment should generate correct secure attachment URL when given a style definition.
|
5505
|
+
---------------------------------------------------------------------------------------------------------------
|
5506
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5507
|
+
[1m[35m (0.2ms)[0m [1m[31mrollback transaction[0m
|
5508
|
+
[1m[35m (0.4ms)[0m [1m[36mbegin transaction[0m
|
5509
|
+
---------------------------------------------------------------------------------------
|
5510
|
+
AttachmentTest: test_: Attachment should raise error if no secret has been configured.
|
5511
|
+
---------------------------------------------------------------------------------------
|
5512
|
+
[1m[36mPhoto Load (0.3ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5513
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5514
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5515
|
+
---------------------------------------------------------------------------------------------------------------------
|
5516
|
+
AttachmentTest: test_: Attachment should delete styles passed to #delete_styles and maintain existing delete queued.
|
5517
|
+
---------------------------------------------------------------------------------------------------------------------
|
5518
|
+
[1m[36mPhoto Load (0.2ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5519
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5520
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5521
|
+
-------------------------------------------------------------------------------------
|
5522
|
+
AttachmentTest: test_: Attachment should include existing dynamic styles in #styles.
|
5523
|
+
-------------------------------------------------------------------------------------
|
5524
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5525
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5526
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5527
|
+
---------------------------------------------------------------------------------------------------
|
5528
|
+
AttachmentTest: test_: Attachment should use DynamicPaperclip::Attachment for dynamic attachments.
|
5529
|
+
---------------------------------------------------------------------------------------------------
|
5530
|
+
[1m[35m (0.1ms)[0m [1m[31mrollback transaction[0m
|
5531
|
+
[1m[35m (0.1ms)[0m [1m[36mbegin transaction[0m
|
5532
|
+
---------------------------------------------------------------------------------------------------------------------
|
5533
|
+
DynamicAttachmentStylesTest: test_: DynamicAttachmentStyles should generate dynamic style and send it to the client.
|
5534
|
+
---------------------------------------------------------------------------------------------------------------------
|
5535
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5536
|
+
Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2018-11-28 12:02:06 -0500
|
5537
|
+
[1m[36mPhoto Load (0.1ms)[0m [1m[34mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT ?[0m [["id", 1], ["LIMIT", 1]]
|
5538
|
+
Command :: file -b --mime '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-62681-i31zfe.png'
|
5539
|
+
Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-62681-1d6ikc3.png[0]' 2>/dev/null
|
5540
|
+
Command :: identify -format %m '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-62681-1d6ikc3.png[0]'
|
5541
|
+
Command :: convert '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-62681-1d6ikc3.png[0]' -auto-orient -resize "100x100" '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/144ee7012c69b8b06c56f6f90a39a39220181128-62681-1pg8hnk'
|
5542
|
+
[1m[35m (0.2ms)[0m [1m[35mSAVEPOINT active_record_1[0m
|
5543
|
+
[1m[35mSQL (1.3ms)[0m [1m[33mUPDATE "photos" SET "image_file_size" = ?, "image_updated_at" = ?, "updated_at" = ?, "image_file_name" = ? WHERE "photos"."id" = ?[0m [["image_file_size", 6646], ["image_updated_at", "2018-11-28 17:02:06.710591"], ["updated_at", "2018-11-28 17:02:06.827831"], ["image_file_name", "rails.png"], ["id", 1]]
|
5544
|
+
[1m[35m (0.1ms)[0m [1m[35mRELEASE SAVEPOINT active_record_1[0m
|
5545
|
+
[1m[35m (0.6ms)[0m [1m[31mrollback transaction[0m
|
5546
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5547
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5548
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.2ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
5549
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5550
|
+
-------------------------------------------------------------------------------------
|
5551
|
+
InstallGeneratorTest: test_generates_secret_and_configures_DynamicPaperclip_to_use_it
|
5552
|
+
-------------------------------------------------------------------------------------
|
5553
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5554
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5555
|
+
[1m[36mFixture Delete (0.3ms)[0m [1mDELETE FROM "photos"[0m
|
5556
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "photos" ("id", "image_file_name", "image_content_type", "created_at", "updated_at") VALUES (1, 'rails.png', 'image/png', '2018-11-28 17:09:21', '2018-11-28 17:09:21')
|
5557
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "photos" ("id", "created_at", "updated_at") VALUES (2, '2018-11-28 17:09:21', '2018-11-28 17:09:21')[0m
|
5558
|
+
[1m[35m (0.6ms)[0m commit transaction
|
5559
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
5560
|
+
------------------------------------------------------------------------------------------------------------------------------------------------------
|
5561
|
+
AttachmentTest: test_: Attachment should add dynamic style to #styles and reprocess it when a dynamic style name is passed to #process_dynamic_style.
|
5562
|
+
------------------------------------------------------------------------------------------------------------------------------------------------------
|
5563
|
+
[1m[35mPhoto Load (0.2ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
5564
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5565
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5566
|
+
---------------------------------------------------------------------------------------------------------------------
|
5567
|
+
AttachmentTest: test_: Attachment should delete styles passed to #delete_styles and maintain existing delete queued.
|
5568
|
+
---------------------------------------------------------------------------------------------------------------------
|
5569
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
5570
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
5571
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
5572
|
+
---------------------------------------------------------------------------------------------------------------
|
5573
|
+
AttachmentTest: test_: Attachment should generate correct secure attachment URL when given a style definition.
|
5574
|
+
---------------------------------------------------------------------------------------------------------------
|
5575
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
5576
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5577
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5578
|
+
-------------------------------------------------------------------------------------
|
5579
|
+
AttachmentTest: test_: Attachment should include existing dynamic styles in #styles.
|
5580
|
+
-------------------------------------------------------------------------------------
|
5581
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
5582
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
5583
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
5584
|
+
-----------------------------------------------------------------------------------------
|
5585
|
+
AttachmentTest: test_: Attachment should only include dynamic styles in #dynamic_styles.
|
5586
|
+
-----------------------------------------------------------------------------------------
|
5587
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
5588
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5589
|
+
[1m[35m (0.1ms)[0m begin transaction
|
5590
|
+
---------------------------------------------------------------------------------------
|
5591
|
+
AttachmentTest: test_: Attachment should raise error if no secret has been configured.
|
5592
|
+
---------------------------------------------------------------------------------------
|
5593
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
5594
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
5595
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
5596
|
+
----------------------------------------------------------------------------------------------------
|
5597
|
+
AttachmentTest: test_: Attachment should return false from query method when attachment is not set.
|
5598
|
+
----------------------------------------------------------------------------------------------------
|
5599
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 2]]
|
5600
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
5601
|
+
[1m[35m (0.0ms)[0m begin transaction
|
5602
|
+
-----------------------------------------------------------------------------------------------
|
5603
|
+
AttachmentTest: test_: Attachment should return true from query method when attachment is set.
|
5604
|
+
-----------------------------------------------------------------------------------------------
|
5605
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
5606
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
5607
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
5608
|
+
---------------------------------------------------------------------------------------------------
|
5609
|
+
AttachmentTest: test_: Attachment should use DynamicPaperclip::Attachment for dynamic attachments.
|
5610
|
+
---------------------------------------------------------------------------------------------------
|
5611
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
5612
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
5613
|
+
--------------------------------
|
5614
|
+
DynamicPaperclipTest: test_truth
|
5615
|
+
--------------------------------
|
5616
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
5617
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
5618
|
+
---------------------------------------------------------------------------------------------------------------------
|
5619
|
+
DynamicAttachmentStylesTest: test_: DynamicAttachmentStyles should generate dynamic style and send it to the client.
|
5620
|
+
---------------------------------------------------------------------------------------------------------------------
|
5621
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
5622
|
+
Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2018-11-28 12:09:21 -0500
|
5623
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
5624
|
+
[paperclip] Trying to link /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-63225-g6srmw.png to /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-63225-mztlk7.png
|
5625
|
+
Command :: file -b --mime '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-63225-mztlk7.png'
|
5626
|
+
Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-63225-g6srmw.png[0]' 2>/dev/null
|
5627
|
+
Command :: identify -format %m '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-63225-g6srmw.png[0]'
|
5628
|
+
Command :: convert '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4d003d1435f0827cfe18ac2d2a3979e720181128-63225-g6srmw.png[0]' -auto-orient -resize "100x100" '/var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/76121d983a58042e5a46fec21a87c16e20181128-63225-15z93pu'
|
5629
|
+
[paperclip] Trying to link /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/76121d983a58042e5a46fec21a87c16e20181128-63225-15z93pu to /var/folders/fk/ltpzbpl167jfwr6wyty1tc200000gn/T/4a02615c6c08340aece92d8388bbc56220181128-63225-qv3jgm
|
5630
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
5631
|
+
[1m[36mSQL (1.1ms)[0m [1mUPDATE "photos" SET "image_file_size" = ?, "image_updated_at" = ?, "image_file_name" = ?, "updated_at" = ? WHERE "photos"."id" = ?[0m [["image_file_size", 6646], ["image_updated_at", "2018-11-28 17:09:21.579296"], ["image_file_name", "rails.png"], ["updated_at", "2018-11-28 17:09:21.683165"], ["id", 1]]
|
5632
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
5633
|
+
[1m[36m (0.6ms)[0m [1mrollback transaction[0m
|
@@ -19,7 +19,7 @@ class DynamicPaperclip::AttachmentStyleGeneratorTest < MiniTest::Unit::TestCase
|
|
19
19
|
@app = stub('Application', :call => [200, {}, ''])
|
20
20
|
|
21
21
|
@foo = stub('foo')
|
22
|
-
@attachment = stub('image attachment', :path => File.join(FIXTURES_DIR, 'rails.png'), :content_type => 'image/jpeg')
|
22
|
+
@attachment = stub('image attachment', :path => File.join(FIXTURES_DIR, 'rails.png'), :original_filename => 'rails.png', :content_type => 'image/jpeg')
|
23
23
|
@attachment.stubs(:exists?).returns(true)
|
24
24
|
|
25
25
|
Foo.stubs(:find).with(1).returns @foo
|
@@ -30,66 +30,69 @@ class DynamicPaperclip::AttachmentStyleGeneratorTest < MiniTest::Unit::TestCase
|
|
30
30
|
@attachment.expects(:exists?).with(:dynamic_42x42).returns(true)
|
31
31
|
@attachment.expects(:process_dynamic_style).never
|
32
32
|
|
33
|
-
get '/system/foos/images/1/dynamic_42x42/
|
33
|
+
get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
|
34
34
|
end
|
35
35
|
|
36
36
|
should 'process style if it is dynamic and does not exist' do
|
37
37
|
@attachment.expects(:exists?).with(:dynamic_42x42).returns(false)
|
38
38
|
@attachment.expects(:process_dynamic_style).once
|
39
39
|
|
40
|
-
get '/system/foos/images/1/dynamic_42x42/
|
40
|
+
get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
|
41
41
|
end
|
42
42
|
|
43
43
|
should 'find record when an ID is used' do
|
44
44
|
Foo.expects(:find).with(1).returns @foo
|
45
45
|
|
46
|
-
get '/system/foos/images/1/dynamic_42x42/
|
46
|
+
get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
|
47
47
|
end
|
48
48
|
|
49
49
|
should 'find record when an ID partition is used' do
|
50
50
|
@foo.stubs(:image_with_id_partition_in_url).returns @attachment
|
51
51
|
Foo.expects(:find).with(10042).returns @foo
|
52
52
|
|
53
|
-
get '/system/foos/image_with_id_partition_in_urls/000/010/042/dynamic_42x42/
|
53
|
+
get '/system/foos/image_with_id_partition_in_urls/000/010/042/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
|
54
54
|
end
|
55
55
|
|
56
56
|
should 'respond with correct content type' do
|
57
|
-
get '/system/foos/images/1/dynamic_42x42/
|
57
|
+
get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
|
58
58
|
|
59
59
|
assert_equal 'image/jpeg', last_response.header['Content-Type']
|
60
60
|
end
|
61
61
|
|
62
62
|
should 'respond with correct content-disposition' do
|
63
|
-
get '/system/foos/images/1/dynamic_42x42/
|
63
|
+
get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
|
64
64
|
|
65
65
|
assert_equal 'inline; filename=rails.png', last_response.header['Content-Disposition']
|
66
66
|
end
|
67
67
|
|
68
68
|
should 'respond with correct content-transfer-encoding' do
|
69
|
-
get '/system/foos/images/1/dynamic_42x42/
|
69
|
+
get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
|
70
70
|
|
71
71
|
assert_equal 'binary', last_response.header['Content-Transfer-Encoding']
|
72
72
|
end
|
73
73
|
|
74
74
|
should 'respond with FileBody' do
|
75
|
-
|
76
|
-
ActionController::DataStreaming::FileBody
|
75
|
+
# The FileBody class has been moved to another module in Rails 5
|
76
|
+
file_body = defined?(ActionController::DataStreaming::FileBody) ? ActionController::DataStreaming::FileBody : ActionDispatch::Response::FileBody
|
77
77
|
|
78
|
-
|
78
|
+
image_file_body = file_body.new(File.join(FIXTURES_DIR, 'rails.png'))
|
79
|
+
file_body.expects(:new).with(File.join(FIXTURES_DIR, 'rails.png')).returns(image_file_body)
|
79
80
|
|
80
|
-
|
81
|
+
response = app.call(Rack::MockRequest.env_for('/system/foos/images/1/dynamic_42x42/rails.png?s='+DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42')))
|
82
|
+
|
83
|
+
assert_equal image_file_body, response[2]
|
81
84
|
end
|
82
85
|
|
83
86
|
should 'respond with success' do
|
84
|
-
get '/system/foos/images/1/dynamic_42x42/
|
87
|
+
get '/system/foos/images/1/dynamic_42x42/rails.png', { s: DynamicPaperclip::UrlSecurity.generate_hash('dynamic_42x42') }
|
85
88
|
|
86
89
|
assert last_response.ok?
|
87
90
|
end
|
88
91
|
|
89
92
|
should '403 with empty body if hash does not match style name' do
|
90
|
-
get '/system/foos/images/1/dynamic_42x42/
|
93
|
+
get '/system/foos/images/1/dynamic_42x42/rails.png', { s: 'this is an invalid hash' }
|
91
94
|
|
92
95
|
assert_equal 403, last_response.status
|
93
96
|
assert_equal '', last_response.body
|
94
97
|
end
|
95
|
-
end
|
98
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamic_paperclip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Ryan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 5.0.2
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 5.0.2
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: appraisal
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -210,9 +210,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
210
210
|
version: '0'
|
211
211
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
|
-
- - "
|
213
|
+
- - ">="
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version:
|
215
|
+
version: '0'
|
216
216
|
requirements: []
|
217
217
|
rubyforge_project:
|
218
218
|
rubygems_version: 2.5.1
|
@@ -220,38 +220,38 @@ signing_key:
|
|
220
220
|
specification_version: 4
|
221
221
|
summary: Generate Paperclip attachment styles on the fly
|
222
222
|
test_files:
|
223
|
-
- test/
|
223
|
+
- test/unit/has_attached_file_test.rb
|
224
|
+
- test/unit/attachment_test.rb
|
225
|
+
- test/unit/attachment_style_generator_test.rb
|
224
226
|
- test/dummy/app/models/photo.rb
|
227
|
+
- test/dummy/app/controllers/application_controller.rb
|
228
|
+
- test/dummy/config/routes.rb
|
229
|
+
- test/dummy/config/locales/en.yml
|
230
|
+
- test/dummy/config/environments/test.rb
|
231
|
+
- test/dummy/config/environment.rb
|
225
232
|
- test/dummy/config/application.rb
|
226
233
|
- test/dummy/config/database.yml
|
227
|
-
- test/dummy/config/environment.rb
|
228
|
-
- test/dummy/config/environments/test.rb
|
229
234
|
- test/dummy/config/initializers/dynamic_paperclip.rb
|
230
|
-
- test/dummy/config/initializers/secret_token.rb
|
231
235
|
- test/dummy/config/initializers/session_store.rb
|
232
236
|
- test/dummy/config/initializers/wrap_parameters.rb
|
233
|
-
- test/dummy/config/
|
234
|
-
- test/dummy/config/routes.rb
|
237
|
+
- test/dummy/config/initializers/secret_token.rb
|
235
238
|
- test/dummy/config.ru
|
236
|
-
- test/dummy/
|
237
|
-
- test/dummy/
|
238
|
-
- test/dummy/
|
239
|
-
- test/dummy/log/test.log
|
240
|
-
- test/dummy/public/404.html
|
239
|
+
- test/dummy/script/rails
|
240
|
+
- test/dummy/Rakefile
|
241
|
+
- test/dummy/public/favicon.ico
|
241
242
|
- test/dummy/public/422.html
|
242
243
|
- test/dummy/public/500.html
|
243
|
-
- test/dummy/public/
|
244
|
-
- test/dummy/public/system/photos/images/000/000/001/dynamic_42x42/rails.png
|
244
|
+
- test/dummy/public/404.html
|
245
245
|
- test/dummy/public/system/photos/images/000/000/001/original/rails.png
|
246
|
-
- test/dummy/
|
247
|
-
- test/dummy/
|
246
|
+
- test/dummy/public/system/photos/images/000/000/001/dynamic_42x42/rails.png
|
247
|
+
- test/dummy/db/schema.rb
|
248
|
+
- test/dummy/db/test.sqlite3
|
249
|
+
- test/dummy/db/migrate/20131102002336_create_photos.rb
|
250
|
+
- test/dummy/log/test.log
|
251
|
+
- test/integration/dynamic_attachment_styles_test.rb
|
248
252
|
- test/dynamic_paperclip_test.rb
|
249
253
|
- test/fixtures/photos.yml
|
250
254
|
- test/fixtures/rails.png
|
251
|
-
- test/generators/install_generator_test.rb
|
252
|
-
- test/integration/dynamic_attachment_styles_test.rb
|
253
255
|
- test/test_helper.rb
|
256
|
+
- test/generators/install_generator_test.rb
|
254
257
|
- test/tmp/config/initializers/dynamic_paperclip.rb
|
255
|
-
- test/unit/attachment_style_generator_test.rb
|
256
|
-
- test/unit/attachment_test.rb
|
257
|
-
- test/unit/has_attached_file_test.rb
|