dynamic_paperclip 1.0.0a.2 → 1.0.0a.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -43,6 +43,17 @@ module DynamicPaperclip
|
|
43
43
|
"#{url}#{delimiter_char}s=#{UrlSecurity.generate_hash(style_name)}"
|
44
44
|
end
|
45
45
|
|
46
|
+
# Immediately deletes given styles without impacting existing delete queue
|
47
|
+
def delete_styles(*styles)
|
48
|
+
old_delete_queue = @queued_for_delete
|
49
|
+
|
50
|
+
@queued_for_delete = []
|
51
|
+
queue_some_for_delete *styles
|
52
|
+
flush_deletes
|
53
|
+
|
54
|
+
@queued_for_delete = old_delete_queue
|
55
|
+
end
|
56
|
+
|
46
57
|
private
|
47
58
|
|
48
59
|
def add_dynamic_style!(name)
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/test/dummy/log/test.log
CHANGED
@@ -23397,3 +23397,147 @@ Command :: file -b --mime '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rail
|
|
23397
23397
|
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23398
23398
|
[1m[35m (0.0ms)[0m begin transaction
|
23399
23399
|
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23400
|
+
Connecting to database specified by database.yml
|
23401
|
+
[1m[36m (11.1ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
23402
|
+
Migrating to CreatePhotos (20131102002336)
|
23403
|
+
Connecting to database specified by database.yml
|
23404
|
+
[1m[36m (1.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
23405
|
+
Migrating to CreatePhotos (20131102002336)
|
23406
|
+
Connecting to database specified by database.yml
|
23407
|
+
[1m[36m (1.3ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
23408
|
+
Migrating to CreatePhotos (20131102002336)
|
23409
|
+
Connecting to database specified by database.yml
|
23410
|
+
[1m[36m (1.2ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
23411
|
+
Migrating to CreatePhotos (20131102002336)
|
23412
|
+
[1m[35m (0.1ms)[0m begin transaction
|
23413
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "photos"[0m
|
23414
|
+
[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', '2014-08-14 19:14:46', '2014-08-14 19:14:46')
|
23415
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
23416
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23417
|
+
[1m[36mPhoto Load (0.2ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
23418
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
23419
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23420
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
23421
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23422
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23423
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
23424
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23425
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23426
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
23427
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23428
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23429
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
23430
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23431
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23432
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
23433
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23434
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23435
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23436
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23437
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
23438
|
+
Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2014-08-14 15:14:47 -0400
|
23439
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
23440
|
+
Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94331-1v62tr8.png[0]'
|
23441
|
+
Command :: identify -format %m '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94331-1v62tr8.png[0]'
|
23442
|
+
Command :: identify -format %m '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94331-1v62tr8.png[0]'
|
23443
|
+
Command :: identify -format %m '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94331-1v62tr8.png[0]'
|
23444
|
+
Command :: convert '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94331-1v62tr8.png[0]' -auto-orient -resize "100x100" '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94331-1v62tr820140814-94331-572yd5'
|
23445
|
+
Command :: file -b --mime '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94331-1v62tr820140814-94331-572yd5'
|
23446
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
23447
|
+
[1m[35m (0.3ms)[0m UPDATE "photos" SET "image_file_size" = 6646, "image_updated_at" = '2014-08-14 19:14:47.051994', "image_file_name" = 'rails.png', "updated_at" = '2014-08-14 19:14:47.372748' WHERE "photos"."id" = 1
|
23448
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
23449
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
23450
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
23451
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23452
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23453
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23454
|
+
Connecting to database specified by database.yml
|
23455
|
+
[1m[36m (1.7ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
23456
|
+
Migrating to CreatePhotos (20131102002336)
|
23457
|
+
[1m[35m (0.1ms)[0m begin transaction
|
23458
|
+
[1m[36mFixture Delete (0.4ms)[0m [1mDELETE FROM "photos"[0m
|
23459
|
+
[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', '2014-08-14 19:15:12', '2014-08-14 19:15:12')
|
23460
|
+
[1m[36m (0.5ms)[0m [1mcommit transaction[0m
|
23461
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23462
|
+
[1m[36mPhoto Load (0.2ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
23463
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
23464
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23465
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
23466
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23467
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23468
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
23469
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23470
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23471
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
23472
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23473
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23474
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
23475
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23476
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23477
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
23478
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23479
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23480
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23481
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23482
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
23483
|
+
Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2014-08-14 15:15:12 -0400
|
23484
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
23485
|
+
Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94412-1l84rag.png[0]'
|
23486
|
+
Command :: identify -format %m '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94412-1l84rag.png[0]'
|
23487
|
+
Command :: identify -format %m '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94412-1l84rag.png[0]'
|
23488
|
+
Command :: identify -format %m '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94412-1l84rag.png[0]'
|
23489
|
+
Command :: convert '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94412-1l84rag.png[0]' -auto-orient -resize "100x100" '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94412-1l84rag20140814-94412-m02l5u'
|
23490
|
+
Command :: file -b --mime '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94412-1l84rag20140814-94412-m02l5u'
|
23491
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
23492
|
+
[1m[35m (0.4ms)[0m UPDATE "photos" SET "image_file_size" = 6646, "image_updated_at" = '2014-08-14 19:15:12.677592', "image_file_name" = 'rails.png', "updated_at" = '2014-08-14 19:15:12.768101' WHERE "photos"."id" = 1
|
23493
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
23494
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
23495
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
23496
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23497
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23498
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23499
|
+
Connecting to database specified by database.yml
|
23500
|
+
[1m[36m (1.4ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
23501
|
+
Migrating to CreatePhotos (20131102002336)
|
23502
|
+
[1m[35m (0.1ms)[0m begin transaction
|
23503
|
+
[1m[36mFixture Delete (0.3ms)[0m [1mDELETE FROM "photos"[0m
|
23504
|
+
[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', '2014-08-14 19:16:10', '2014-08-14 19:16:10')
|
23505
|
+
[1m[36m (0.5ms)[0m [1mcommit transaction[0m
|
23506
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23507
|
+
[1m[36mPhoto Load (0.2ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
23508
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
23509
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23510
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
23511
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23512
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23513
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
23514
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23515
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23516
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
23517
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23518
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23519
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
23520
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23521
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23522
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
23523
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
23524
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23525
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
23526
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23527
|
+
[1m[36mPhoto Load (0.1ms)[0m [1mSELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1[0m [["id", 1]]
|
23528
|
+
Started GET "/system/photos/images/000/000/001/dynamic_100x100/rails.png?s=d2dcb69d514d1030ce01404ebc422423eccf1b02" for 127.0.0.1 at 2014-08-14 15:16:10 -0400
|
23529
|
+
[1m[35mPhoto Load (0.1ms)[0m SELECT "photos".* FROM "photos" WHERE "photos"."id" = ? LIMIT 1 [["id", 1]]
|
23530
|
+
Command :: identify -format '%wx%h,%[exif:orientation]' '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94730-1fp83ta.png[0]'
|
23531
|
+
Command :: identify -format %m '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94730-1fp83ta.png[0]'
|
23532
|
+
Command :: identify -format %m '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94730-1fp83ta.png[0]'
|
23533
|
+
Command :: identify -format %m '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94730-1fp83ta.png[0]'
|
23534
|
+
Command :: convert '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94730-1fp83ta.png[0]' -auto-orient -resize "100x100" '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94730-1fp83ta20140814-94730-1uedefb'
|
23535
|
+
Command :: file -b --mime '/var/folders/sd/669fr45168q7jsmsp132kqfr0000gn/T/rails20140814-94730-1fp83ta20140814-94730-1uedefb'
|
23536
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
23537
|
+
[1m[35m (0.3ms)[0m UPDATE "photos" SET "image_file_size" = 6646, "image_updated_at" = '2014-08-14 19:16:10.801089', "image_file_name" = 'rails.png', "updated_at" = '2014-08-14 19:16:10.891646' WHERE "photos"."id" = 1
|
23538
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
23539
|
+
[1m[35m (0.3ms)[0m rollback transaction
|
23540
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
23541
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
23542
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
23543
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
@@ -38,4 +38,17 @@ class AttachmentTest < ActiveSupport::TestCase
|
|
38
38
|
|
39
39
|
assert_equal '42x42', attachment.styles[:dynamic_42x42].geometry
|
40
40
|
end
|
41
|
+
|
42
|
+
should 'delete styles passed to #delete_styles and maintain existing delete queued' do
|
43
|
+
attachment = photos(:rails).image
|
44
|
+
|
45
|
+
attachment.instance_variable_set :@queued_for_delete, [:thumb]
|
46
|
+
|
47
|
+
attachment.expects(:queue_some_for_delete).with(:foo, :bar)
|
48
|
+
attachment.expects(:flush_deletes)
|
49
|
+
|
50
|
+
attachment.delete_styles :foo, :bar
|
51
|
+
|
52
|
+
assert_equal [:thumb], attachment.instance_variable_get(:@queued_for_delete)
|
53
|
+
end
|
41
54
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamic_paperclip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0a.
|
4
|
+
version: 1.0.0a.3
|
5
5
|
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-08-
|
12
|
+
date: 2014-08-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -217,7 +217,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
217
217
|
version: '0'
|
218
218
|
segments:
|
219
219
|
- 0
|
220
|
-
hash:
|
220
|
+
hash: 2099875005983279561
|
221
221
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
222
222
|
none: false
|
223
223
|
requirements:
|