paperclip 3.4.2 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of paperclip might be problematic. Click here for more details.
- checksums.yaml +15 -0
- data/.travis.yml +0 -1
- data/Appraisals +4 -4
- data/NEWS +16 -0
- data/README.md +21 -2
- data/features/step_definitions/rails_steps.rb +9 -0
- data/features/step_definitions/s3_steps.rb +1 -1
- data/features/support/fakeweb.rb +4 -1
- data/lib/paperclip.rb +6 -42
- data/lib/paperclip/attachment.rb +25 -27
- data/lib/paperclip/filename_cleaner.rb +16 -0
- data/lib/paperclip/glue.rb +0 -1
- data/lib/paperclip/has_attached_file.rb +86 -0
- data/lib/paperclip/io_adapters/abstract_adapter.rb +8 -0
- data/lib/paperclip/io_adapters/data_uri_adapter.rb +27 -0
- data/lib/paperclip/io_adapters/empty_string_adapter.rb +18 -0
- data/lib/paperclip/io_adapters/stringio_adapter.rb +3 -3
- data/lib/paperclip/matchers/have_attached_file_matcher.rb +1 -5
- data/lib/paperclip/missing_attachment_styles.rb +11 -16
- data/lib/paperclip/storage/filesystem.rb +7 -3
- data/lib/paperclip/storage/s3.rb +2 -0
- data/lib/paperclip/tasks/attachments.rb +59 -0
- data/lib/paperclip/validators.rb +21 -2
- data/lib/paperclip/validators/attachment_content_type_validator.rb +9 -2
- data/lib/paperclip/validators/attachment_presence_validator.rb +8 -8
- data/lib/paperclip/validators/attachment_size_validator.rb +12 -7
- data/lib/paperclip/version.rb +1 -1
- data/lib/tasks/paperclip.rake +24 -6
- data/paperclip.gemspec +5 -3
- data/test/attachment_processing_test.rb +69 -15
- data/test/attachment_test.rb +49 -0
- data/test/filename_cleaner_test.rb +14 -0
- data/test/has_attached_file_test.rb +109 -0
- data/test/helper.rb +1 -1
- data/test/integration_test.rb +1 -65
- data/test/io_adapters/abstract_adapter_test.rb +8 -0
- data/test/io_adapters/data_uri_adapter_test.rb +60 -0
- data/test/io_adapters/empty_string_adapter_test.rb +17 -0
- data/test/paperclip_missing_attachment_styles_test.rb +4 -8
- data/test/paperclip_test.rb +0 -5
- data/test/rake_test.rb +103 -0
- data/test/storage/s3_test.rb +13 -1
- data/test/tasks/attachments_test.rb +77 -0
- data/test/validators/attachment_content_type_validator_test.rb +26 -0
- data/test/validators/attachment_size_validator_test.rb +10 -0
- data/test/validators_test.rb +8 -1
- metadata +56 -77
- data/lib/paperclip/attachment_options.rb +0 -9
- data/lib/paperclip/instance_methods.rb +0 -35
- data/test/attachment_options_test.rb +0 -27
@@ -0,0 +1,17 @@
|
|
1
|
+
require './test/helper'
|
2
|
+
|
3
|
+
class EmptyStringAdapterTest < Test::Unit::TestCase
|
4
|
+
context 'a new instance' do
|
5
|
+
setup do
|
6
|
+
@subject = Paperclip.io_adapters.for('')
|
7
|
+
end
|
8
|
+
|
9
|
+
should "return false for a call to nil?" do
|
10
|
+
assert !@subject.nil?
|
11
|
+
end
|
12
|
+
|
13
|
+
should 'return false for a call to assignment?' do
|
14
|
+
assert !@subject.assignment?
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,23 +1,19 @@
|
|
1
1
|
require './test/helper'
|
2
2
|
|
3
3
|
class PaperclipMissingAttachmentStylesTest < Test::Unit::TestCase
|
4
|
+
def setup
|
5
|
+
Paperclip::Tasks::Attachments.clear
|
6
|
+
end
|
4
7
|
|
5
8
|
context "Paperclip" do
|
6
9
|
setup do
|
7
|
-
Paperclip.
|
10
|
+
Paperclip::Tasks::Attachments.clear
|
8
11
|
end
|
9
12
|
|
10
13
|
teardown do
|
11
14
|
File.unlink(Paperclip.registered_attachments_styles_path) rescue nil
|
12
15
|
end
|
13
16
|
|
14
|
-
should "be able to keep list of models using it" do
|
15
|
-
assert_kind_of Set, Paperclip.classes_with_attachments
|
16
|
-
assert Paperclip.classes_with_attachments.empty?, 'list should be empty'
|
17
|
-
rebuild_model
|
18
|
-
assert_equal ['Dummy'].to_set, Paperclip.classes_with_attachments
|
19
|
-
end
|
20
|
-
|
21
17
|
should "enable to get and set path to registered styles file" do
|
22
18
|
assert_equal ROOT.join('tmp/public/system/paperclip_attachments.yml').to_s, Paperclip.registered_attachments_styles_path
|
23
19
|
Paperclip.registered_attachments_styles_path = '/tmp/config/paperclip_attachments.yml'
|
data/test/paperclip_test.rb
CHANGED
@@ -159,11 +159,6 @@ class PaperclipTest < Test::Unit::TestCase
|
|
159
159
|
end
|
160
160
|
end
|
161
161
|
|
162
|
-
should "be able to see the attachment definition from the subclass's class" do
|
163
|
-
assert_equal "tmp/:class/omg/:style.:extension",
|
164
|
-
SubDummy.attachment_definitions[:avatar][:path]
|
165
|
-
end
|
166
|
-
|
167
162
|
teardown do
|
168
163
|
SubDummy.delete_all
|
169
164
|
Object.send(:remove_const, "SubDummy") rescue nil
|
data/test/rake_test.rb
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
require './test/helper'
|
2
|
+
require 'rake'
|
3
|
+
load './lib/tasks/paperclip.rake'
|
4
|
+
|
5
|
+
class RakeTest < Test::Unit::TestCase
|
6
|
+
context "calling `rake paperclip:refresh:thumbnails`" do
|
7
|
+
setup do
|
8
|
+
rebuild_model
|
9
|
+
Paperclip::Task.stubs(:obtain_class).returns('Dummy')
|
10
|
+
@bogus_instance = Dummy.new
|
11
|
+
@bogus_instance.id = 'some_id'
|
12
|
+
@bogus_instance.avatar.stubs(:reprocess!)
|
13
|
+
@valid_instance = Dummy.new
|
14
|
+
@valid_instance.avatar.stubs(:reprocess!)
|
15
|
+
Paperclip::Task.stubs(:log_error)
|
16
|
+
Paperclip.stubs(:each_instance_with_attachment).multiple_yields @bogus_instance, @valid_instance
|
17
|
+
end
|
18
|
+
context "when there is an exception in reprocess!" do
|
19
|
+
setup do
|
20
|
+
@bogus_instance.avatar.stubs(:reprocess!).raises
|
21
|
+
end
|
22
|
+
|
23
|
+
should "catch the exception" do
|
24
|
+
assert_nothing_raised do
|
25
|
+
::Rake::Task['paperclip:refresh:thumbnails'].execute
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
should "continue to the next instance" do
|
30
|
+
@valid_instance.avatar.expects(:reprocess!)
|
31
|
+
::Rake::Task['paperclip:refresh:thumbnails'].execute
|
32
|
+
end
|
33
|
+
|
34
|
+
should "print the exception" do
|
35
|
+
exception_msg = 'Some Exception'
|
36
|
+
@bogus_instance.avatar.stubs(:reprocess!).raises(exception_msg)
|
37
|
+
Paperclip::Task.expects(:log_error).with do |str|
|
38
|
+
str.match exception_msg
|
39
|
+
end
|
40
|
+
::Rake::Task['paperclip:refresh:thumbnails'].execute
|
41
|
+
end
|
42
|
+
|
43
|
+
should "print the class name" do
|
44
|
+
Paperclip::Task.expects(:log_error).with do |str|
|
45
|
+
str.match 'Dummy'
|
46
|
+
end
|
47
|
+
::Rake::Task['paperclip:refresh:thumbnails'].execute
|
48
|
+
end
|
49
|
+
|
50
|
+
should "print the instance ID" do
|
51
|
+
Paperclip::Task.expects(:log_error).with do |str|
|
52
|
+
str.match "ID #{@bogus_instance.id}"
|
53
|
+
end
|
54
|
+
::Rake::Task['paperclip:refresh:thumbnails'].execute
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
context "when there is an error in reprocess!" do
|
59
|
+
setup do
|
60
|
+
@errors = mock('errors')
|
61
|
+
@errors.stubs(:full_messages).returns([''])
|
62
|
+
@errors.stubs(:blank?).returns(false)
|
63
|
+
@bogus_instance.stubs(:errors).returns(@errors)
|
64
|
+
end
|
65
|
+
|
66
|
+
should "continue to the next instance" do
|
67
|
+
@valid_instance.avatar.expects(:reprocess!)
|
68
|
+
::Rake::Task['paperclip:refresh:thumbnails'].execute
|
69
|
+
end
|
70
|
+
|
71
|
+
should "print the error" do
|
72
|
+
error_msg = 'Some Error'
|
73
|
+
@errors.stubs(:full_messages).returns([error_msg])
|
74
|
+
Paperclip::Task.expects(:log_error).with do |str|
|
75
|
+
str.match error_msg
|
76
|
+
end
|
77
|
+
::Rake::Task['paperclip:refresh:thumbnails'].execute
|
78
|
+
end
|
79
|
+
|
80
|
+
should "print the class name" do
|
81
|
+
Paperclip::Task.expects(:log_error).with do |str|
|
82
|
+
str.match 'Dummy'
|
83
|
+
end
|
84
|
+
::Rake::Task['paperclip:refresh:thumbnails'].execute
|
85
|
+
end
|
86
|
+
|
87
|
+
should "print the instance ID" do
|
88
|
+
Paperclip::Task.expects(:log_error).with do |str|
|
89
|
+
str.match "ID #{@bogus_instance.id}"
|
90
|
+
end
|
91
|
+
::Rake::Task['paperclip:refresh:thumbnails'].execute
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
context "Paperclip::Task.log_error method" do
|
97
|
+
should "print its argument to STDERR" do
|
98
|
+
msg = 'Some Message'
|
99
|
+
$stderr.expects(:puts).with(msg)
|
100
|
+
Paperclip::Task.log_error(msg)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
data/test/storage/s3_test.rb
CHANGED
@@ -539,6 +539,18 @@ class S3Test < Test::Unit::TestCase
|
|
539
539
|
end
|
540
540
|
end
|
541
541
|
|
542
|
+
context "#expiring_url" do
|
543
|
+
setup { @dummy = Dummy.new }
|
544
|
+
|
545
|
+
context "with no attachment" do
|
546
|
+
setup { assert(!@dummy.avatar.exists?) }
|
547
|
+
|
548
|
+
should "return the default URL" do
|
549
|
+
assert_equal(@dummy.avatar.url, @dummy.avatar.expiring_url)
|
550
|
+
end
|
551
|
+
end
|
552
|
+
end
|
553
|
+
|
542
554
|
context "Generating a url with an expiration for each style" do
|
543
555
|
setup do
|
544
556
|
rebuild_model :storage => :s3,
|
@@ -709,7 +721,7 @@ class S3Test < Test::Unit::TestCase
|
|
709
721
|
setup do
|
710
722
|
AWS::S3::S3Object.any_instance.stubs(:exists?).returns(true)
|
711
723
|
AWS::S3::S3Object.any_instance.stubs(:delete)
|
712
|
-
@dummy.
|
724
|
+
@dummy.destroy
|
713
725
|
end
|
714
726
|
|
715
727
|
should "succeed" do
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require './test/helper'
|
2
|
+
require 'paperclip/tasks/attachments'
|
3
|
+
|
4
|
+
class AttachmentsTest < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
Paperclip::Tasks::Attachments.clear
|
7
|
+
end
|
8
|
+
|
9
|
+
context '.names_for' do
|
10
|
+
should 'include attachment names for the given class' do
|
11
|
+
foo = Class.new
|
12
|
+
Paperclip::Tasks::Attachments.add(foo, :avatar, {})
|
13
|
+
|
14
|
+
assert_equal [:avatar], Paperclip::Tasks::Attachments.names_for(foo)
|
15
|
+
end
|
16
|
+
|
17
|
+
should 'not include attachment names for other classes' do
|
18
|
+
foo = Class.new
|
19
|
+
bar = Class.new
|
20
|
+
Paperclip::Tasks::Attachments.add(foo, :avatar, {})
|
21
|
+
Paperclip::Tasks::Attachments.add(bar, :lover, {})
|
22
|
+
|
23
|
+
assert_equal [:lover], Paperclip::Tasks::Attachments.names_for(bar)
|
24
|
+
end
|
25
|
+
|
26
|
+
should 'produce the empty array for a missing key' do
|
27
|
+
assert_empty Paperclip::Tasks::Attachments.names_for(Class.new)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context '.each_definition' do
|
32
|
+
should 'call the block with the class, attachment name, and options' do
|
33
|
+
foo = Class.new
|
34
|
+
expected_accumulations = [
|
35
|
+
[foo,:avatar, { yo: 'greeting' }],
|
36
|
+
[foo, :greeter, { ciao: 'greeting' }]
|
37
|
+
]
|
38
|
+
expected_accumulations.each do |args|
|
39
|
+
Paperclip::Tasks::Attachments.add(*args)
|
40
|
+
end
|
41
|
+
accumulations = []
|
42
|
+
|
43
|
+
Paperclip::Tasks::Attachments.each_definition do |*args|
|
44
|
+
accumulations << args
|
45
|
+
end
|
46
|
+
|
47
|
+
assert_equal expected_accumulations, accumulations
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
context '.definitions_for' do
|
52
|
+
should 'produce the attachment name and options' do
|
53
|
+
expected_definitions = {
|
54
|
+
avatar: { yo: 'greeting' },
|
55
|
+
greeter: { ciao: 'greeting' }
|
56
|
+
}
|
57
|
+
foo = Class.new
|
58
|
+
Paperclip::Tasks::Attachments.add(foo, :avatar, { yo: 'greeting' })
|
59
|
+
Paperclip::Tasks::Attachments.add(foo, :greeter, { ciao: 'greeting' })
|
60
|
+
|
61
|
+
definitions = Paperclip::Tasks::Attachments.definitions_for(foo)
|
62
|
+
|
63
|
+
assert_equal expected_definitions, definitions
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
context '.clear' do
|
68
|
+
should 'remove all of the existing attachment definitions' do
|
69
|
+
foo = Class.new
|
70
|
+
Paperclip::Tasks::Attachments.add(foo, :greeter, { ciao: 'greeting' })
|
71
|
+
|
72
|
+
Paperclip::Tasks::Attachments.clear
|
73
|
+
|
74
|
+
assert_empty Paperclip::Tasks::Attachments.names_for(foo)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -50,6 +50,32 @@ class AttachmentContentTypeValidatorTest < Test::Unit::TestCase
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
+
context "with a failing validation" do
|
54
|
+
setup do
|
55
|
+
build_validator :content_type => "image/png", :allow_nil => false
|
56
|
+
@dummy.stubs(:avatar_content_type => nil)
|
57
|
+
@validator.validate(@dummy)
|
58
|
+
end
|
59
|
+
|
60
|
+
should "add error to the base object" do
|
61
|
+
assert @dummy.errors[:avatar].present?,
|
62
|
+
"Error not added to base attribute"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
context "with a successful validation" do
|
67
|
+
setup do
|
68
|
+
build_validator :content_type => "image/png", :allow_nil => false
|
69
|
+
@dummy.stubs(:avatar_content_type => "image/png")
|
70
|
+
@validator.validate(@dummy)
|
71
|
+
end
|
72
|
+
|
73
|
+
should "not add error to the base object" do
|
74
|
+
assert @dummy.errors[:avatar].blank?,
|
75
|
+
"Error was added to base attribute"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
53
79
|
context "with :allow_blank option" do
|
54
80
|
context "as true" do
|
55
81
|
setup do
|
@@ -20,6 +20,11 @@ class AttachmentSizeValidatorTest < Test::Unit::TestCase
|
|
20
20
|
assert @dummy.errors[:avatar_file_size].blank?,
|
21
21
|
"Expect an error message on :avatar_file_size, got none."
|
22
22
|
end
|
23
|
+
|
24
|
+
should "not add error to the base dummy object" do
|
25
|
+
assert @dummy.errors[:avatar].blank?,
|
26
|
+
"Error added to base attribute"
|
27
|
+
end
|
23
28
|
end
|
24
29
|
end
|
25
30
|
|
@@ -35,6 +40,11 @@ class AttachmentSizeValidatorTest < Test::Unit::TestCase
|
|
35
40
|
"Unexpected error message on :avatar_file_size"
|
36
41
|
end
|
37
42
|
|
43
|
+
should "add error to the base dummy object" do
|
44
|
+
assert @dummy.errors[:avatar].present?,
|
45
|
+
"Error not added to base attribute"
|
46
|
+
end
|
47
|
+
|
38
48
|
if options[:message]
|
39
49
|
should "return a correct error message" do
|
40
50
|
assert_includes @dummy.errors[:avatar_file_size], options[:message]
|
data/test/validators_test.rb
CHANGED
@@ -7,7 +7,7 @@ class ValidatorsTest < Test::Unit::TestCase
|
|
7
7
|
|
8
8
|
context "using the helper" do
|
9
9
|
setup do
|
10
|
-
Dummy.validates_attachment :avatar, :presence => true, :content_type => { :content_type => "image/
|
10
|
+
Dummy.validates_attachment :avatar, :presence => true, :content_type => { :content_type => "image/jpeg" }, :size => { :in => 0..10.kilobytes }
|
11
11
|
end
|
12
12
|
|
13
13
|
should "add the attachment_presence validator to the class" do
|
@@ -21,5 +21,12 @@ class ValidatorsTest < Test::Unit::TestCase
|
|
21
21
|
should "add the attachment_size validator to the class" do
|
22
22
|
assert Dummy.validators_on(:avatar).any?{ |validator| validator.kind == :attachment_size }
|
23
23
|
end
|
24
|
+
|
25
|
+
should 'prevent you from attaching a file that violates that validation' do
|
26
|
+
Dummy.class_eval{ validate(:name) { raise "DO NOT RUN THIS" } }
|
27
|
+
dummy = Dummy.new(:avatar => File.new(fixture_file("12k.png")))
|
28
|
+
assert_equal [:avatar_content_type, :avatar, :avatar_file_size], dummy.errors.keys
|
29
|
+
assert_raise(RuntimeError){ dummy.valid? }
|
30
|
+
end
|
24
31
|
end
|
25
32
|
end
|
metadata
CHANGED
@@ -1,36 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
5
|
-
prerelease:
|
4
|
+
version: 3.5.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jon Yurek
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-07-19 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: activerecord
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 3.0.0
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ! '>='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 3.0.0
|
30
13
|
- !ruby/object:Gem::Dependency
|
31
14
|
name: activemodel
|
32
15
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
16
|
requirements:
|
35
17
|
- - ! '>='
|
36
18
|
- !ruby/object:Gem::Version
|
@@ -38,7 +20,6 @@ dependencies:
|
|
38
20
|
type: :runtime
|
39
21
|
prerelease: false
|
40
22
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
23
|
requirements:
|
43
24
|
- - ! '>='
|
44
25
|
- !ruby/object:Gem::Version
|
@@ -46,7 +27,6 @@ dependencies:
|
|
46
27
|
- !ruby/object:Gem::Dependency
|
47
28
|
name: activesupport
|
48
29
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
30
|
requirements:
|
51
31
|
- - ! '>='
|
52
32
|
- !ruby/object:Gem::Version
|
@@ -54,7 +34,6 @@ dependencies:
|
|
54
34
|
type: :runtime
|
55
35
|
prerelease: false
|
56
36
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
37
|
requirements:
|
59
38
|
- - ! '>='
|
60
39
|
- !ruby/object:Gem::Version
|
@@ -62,7 +41,6 @@ dependencies:
|
|
62
41
|
- !ruby/object:Gem::Dependency
|
63
42
|
name: cocaine
|
64
43
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
44
|
requirements:
|
67
45
|
- - ~>
|
68
46
|
- !ruby/object:Gem::Version
|
@@ -70,7 +48,6 @@ dependencies:
|
|
70
48
|
type: :runtime
|
71
49
|
prerelease: false
|
72
50
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
51
|
requirements:
|
75
52
|
- - ~>
|
76
53
|
- !ruby/object:Gem::Version
|
@@ -78,7 +55,6 @@ dependencies:
|
|
78
55
|
- !ruby/object:Gem::Dependency
|
79
56
|
name: mime-types
|
80
57
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
58
|
requirements:
|
83
59
|
- - ! '>='
|
84
60
|
- !ruby/object:Gem::Version
|
@@ -86,15 +62,27 @@ dependencies:
|
|
86
62
|
type: :runtime
|
87
63
|
prerelease: false
|
88
64
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
65
|
requirements:
|
91
66
|
- - ! '>='
|
92
67
|
- !ruby/object:Gem::Version
|
93
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activerecord
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 3.0.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 3.0.0
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: shoulda
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
87
|
- - ! '>='
|
100
88
|
- !ruby/object:Gem::Version
|
@@ -102,7 +90,6 @@ dependencies:
|
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
94
|
- - ! '>='
|
108
95
|
- !ruby/object:Gem::Version
|
@@ -110,7 +97,6 @@ dependencies:
|
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: appraisal
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
101
|
- - ! '>='
|
116
102
|
- !ruby/object:Gem::Version
|
@@ -118,7 +104,6 @@ dependencies:
|
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
108
|
- - ! '>='
|
124
109
|
- !ruby/object:Gem::Version
|
@@ -126,7 +111,6 @@ dependencies:
|
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: mocha
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
115
|
- - ! '>='
|
132
116
|
- !ruby/object:Gem::Version
|
@@ -134,7 +118,6 @@ dependencies:
|
|
134
118
|
type: :development
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
122
|
- - ! '>='
|
140
123
|
- !ruby/object:Gem::Version
|
@@ -142,7 +125,6 @@ dependencies:
|
|
142
125
|
- !ruby/object:Gem::Dependency
|
143
126
|
name: aws-sdk
|
144
127
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
128
|
requirements:
|
147
129
|
- - ! '>='
|
148
130
|
- !ruby/object:Gem::Version
|
@@ -150,7 +132,6 @@ dependencies:
|
|
150
132
|
type: :development
|
151
133
|
prerelease: false
|
152
134
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
135
|
requirements:
|
155
136
|
- - ! '>='
|
156
137
|
- !ruby/object:Gem::Version
|
@@ -158,7 +139,6 @@ dependencies:
|
|
158
139
|
- !ruby/object:Gem::Dependency
|
159
140
|
name: bourne
|
160
141
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
142
|
requirements:
|
163
143
|
- - ! '>='
|
164
144
|
- !ruby/object:Gem::Version
|
@@ -166,7 +146,6 @@ dependencies:
|
|
166
146
|
type: :development
|
167
147
|
prerelease: false
|
168
148
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
149
|
requirements:
|
171
150
|
- - ! '>='
|
172
151
|
- !ruby/object:Gem::Version
|
@@ -174,7 +153,6 @@ dependencies:
|
|
174
153
|
- !ruby/object:Gem::Dependency
|
175
154
|
name: sqlite3
|
176
155
|
requirement: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
156
|
requirements:
|
179
157
|
- - ~>
|
180
158
|
- !ruby/object:Gem::Version
|
@@ -182,7 +160,6 @@ dependencies:
|
|
182
160
|
type: :development
|
183
161
|
prerelease: false
|
184
162
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
none: false
|
186
163
|
requirements:
|
187
164
|
- - ~>
|
188
165
|
- !ruby/object:Gem::Version
|
@@ -190,7 +167,6 @@ dependencies:
|
|
190
167
|
- !ruby/object:Gem::Dependency
|
191
168
|
name: cucumber
|
192
169
|
requirement: !ruby/object:Gem::Requirement
|
193
|
-
none: false
|
194
170
|
requirements:
|
195
171
|
- - ~>
|
196
172
|
- !ruby/object:Gem::Version
|
@@ -198,7 +174,6 @@ dependencies:
|
|
198
174
|
type: :development
|
199
175
|
prerelease: false
|
200
176
|
version_requirements: !ruby/object:Gem::Requirement
|
201
|
-
none: false
|
202
177
|
requirements:
|
203
178
|
- - ~>
|
204
179
|
- !ruby/object:Gem::Version
|
@@ -206,7 +181,6 @@ dependencies:
|
|
206
181
|
- !ruby/object:Gem::Dependency
|
207
182
|
name: aruba
|
208
183
|
requirement: !ruby/object:Gem::Requirement
|
209
|
-
none: false
|
210
184
|
requirements:
|
211
185
|
- - ! '>='
|
212
186
|
- !ruby/object:Gem::Version
|
@@ -214,7 +188,6 @@ dependencies:
|
|
214
188
|
type: :development
|
215
189
|
prerelease: false
|
216
190
|
version_requirements: !ruby/object:Gem::Requirement
|
217
|
-
none: false
|
218
191
|
requirements:
|
219
192
|
- - ! '>='
|
220
193
|
- !ruby/object:Gem::Version
|
@@ -222,7 +195,6 @@ dependencies:
|
|
222
195
|
- !ruby/object:Gem::Dependency
|
223
196
|
name: nokogiri
|
224
197
|
requirement: !ruby/object:Gem::Requirement
|
225
|
-
none: false
|
226
198
|
requirements:
|
227
199
|
- - ! '>='
|
228
200
|
- !ruby/object:Gem::Version
|
@@ -230,7 +202,6 @@ dependencies:
|
|
230
202
|
type: :development
|
231
203
|
prerelease: false
|
232
204
|
version_requirements: !ruby/object:Gem::Requirement
|
233
|
-
none: false
|
234
205
|
requirements:
|
235
206
|
- - ! '>='
|
236
207
|
- !ruby/object:Gem::Version
|
@@ -238,23 +209,20 @@ dependencies:
|
|
238
209
|
- !ruby/object:Gem::Dependency
|
239
210
|
name: capybara
|
240
211
|
requirement: !ruby/object:Gem::Requirement
|
241
|
-
none: false
|
242
212
|
requirements:
|
243
|
-
- -
|
213
|
+
- - '='
|
244
214
|
- !ruby/object:Gem::Version
|
245
|
-
version:
|
215
|
+
version: 2.0.3
|
246
216
|
type: :development
|
247
217
|
prerelease: false
|
248
218
|
version_requirements: !ruby/object:Gem::Requirement
|
249
|
-
none: false
|
250
219
|
requirements:
|
251
|
-
- -
|
220
|
+
- - '='
|
252
221
|
- !ruby/object:Gem::Version
|
253
|
-
version:
|
222
|
+
version: 2.0.3
|
254
223
|
- !ruby/object:Gem::Dependency
|
255
224
|
name: bundler
|
256
225
|
requirement: !ruby/object:Gem::Requirement
|
257
|
-
none: false
|
258
226
|
requirements:
|
259
227
|
- - ! '>='
|
260
228
|
- !ruby/object:Gem::Version
|
@@ -262,7 +230,6 @@ dependencies:
|
|
262
230
|
type: :development
|
263
231
|
prerelease: false
|
264
232
|
version_requirements: !ruby/object:Gem::Requirement
|
265
|
-
none: false
|
266
233
|
requirements:
|
267
234
|
- - ! '>='
|
268
235
|
- !ruby/object:Gem::Version
|
@@ -270,7 +237,6 @@ dependencies:
|
|
270
237
|
- !ruby/object:Gem::Dependency
|
271
238
|
name: fog
|
272
239
|
requirement: !ruby/object:Gem::Requirement
|
273
|
-
none: false
|
274
240
|
requirements:
|
275
241
|
- - ! '>='
|
276
242
|
- !ruby/object:Gem::Version
|
@@ -281,7 +247,6 @@ dependencies:
|
|
281
247
|
type: :development
|
282
248
|
prerelease: false
|
283
249
|
version_requirements: !ruby/object:Gem::Requirement
|
284
|
-
none: false
|
285
250
|
requirements:
|
286
251
|
- - ! '>='
|
287
252
|
- !ruby/object:Gem::Version
|
@@ -292,7 +257,6 @@ dependencies:
|
|
292
257
|
- !ruby/object:Gem::Dependency
|
293
258
|
name: pry
|
294
259
|
requirement: !ruby/object:Gem::Requirement
|
295
|
-
none: false
|
296
260
|
requirements:
|
297
261
|
- - ! '>='
|
298
262
|
- !ruby/object:Gem::Version
|
@@ -300,7 +264,20 @@ dependencies:
|
|
300
264
|
type: :development
|
301
265
|
prerelease: false
|
302
266
|
version_requirements: !ruby/object:Gem::Requirement
|
303
|
-
|
267
|
+
requirements:
|
268
|
+
- - ! '>='
|
269
|
+
- !ruby/object:Gem::Version
|
270
|
+
version: '0'
|
271
|
+
- !ruby/object:Gem::Dependency
|
272
|
+
name: pry-debugger
|
273
|
+
requirement: !ruby/object:Gem::Requirement
|
274
|
+
requirements:
|
275
|
+
- - ! '>='
|
276
|
+
- !ruby/object:Gem::Version
|
277
|
+
version: '0'
|
278
|
+
type: :development
|
279
|
+
prerelease: false
|
280
|
+
version_requirements: !ruby/object:Gem::Requirement
|
304
281
|
requirements:
|
305
282
|
- - ! '>='
|
306
283
|
- !ruby/object:Gem::Version
|
@@ -308,7 +285,6 @@ dependencies:
|
|
308
285
|
- !ruby/object:Gem::Dependency
|
309
286
|
name: launchy
|
310
287
|
requirement: !ruby/object:Gem::Requirement
|
311
|
-
none: false
|
312
288
|
requirements:
|
313
289
|
- - ! '>='
|
314
290
|
- !ruby/object:Gem::Version
|
@@ -316,7 +292,6 @@ dependencies:
|
|
316
292
|
type: :development
|
317
293
|
prerelease: false
|
318
294
|
version_requirements: !ruby/object:Gem::Requirement
|
319
|
-
none: false
|
320
295
|
requirements:
|
321
296
|
- - ! '>='
|
322
297
|
- !ruby/object:Gem::Version
|
@@ -324,7 +299,6 @@ dependencies:
|
|
324
299
|
- !ruby/object:Gem::Dependency
|
325
300
|
name: rake
|
326
301
|
requirement: !ruby/object:Gem::Requirement
|
327
|
-
none: false
|
328
302
|
requirements:
|
329
303
|
- - ! '>='
|
330
304
|
- !ruby/object:Gem::Version
|
@@ -332,7 +306,6 @@ dependencies:
|
|
332
306
|
type: :development
|
333
307
|
prerelease: false
|
334
308
|
version_requirements: !ruby/object:Gem::Requirement
|
335
|
-
none: false
|
336
309
|
requirements:
|
337
310
|
- - ! '>='
|
338
311
|
- !ruby/object:Gem::Version
|
@@ -340,7 +313,6 @@ dependencies:
|
|
340
313
|
- !ruby/object:Gem::Dependency
|
341
314
|
name: fakeweb
|
342
315
|
requirement: !ruby/object:Gem::Requirement
|
343
|
-
none: false
|
344
316
|
requirements:
|
345
317
|
- - ! '>='
|
346
318
|
- !ruby/object:Gem::Version
|
@@ -348,7 +320,6 @@ dependencies:
|
|
348
320
|
type: :development
|
349
321
|
prerelease: false
|
350
322
|
version_requirements: !ruby/object:Gem::Requirement
|
351
|
-
none: false
|
352
323
|
requirements:
|
353
324
|
- - ! '>='
|
354
325
|
- !ruby/object:Gem::Version
|
@@ -356,7 +327,6 @@ dependencies:
|
|
356
327
|
- !ruby/object:Gem::Dependency
|
357
328
|
name: railties
|
358
329
|
requirement: !ruby/object:Gem::Requirement
|
359
|
-
none: false
|
360
330
|
requirements:
|
361
331
|
- - ! '>='
|
362
332
|
- !ruby/object:Gem::Version
|
@@ -364,7 +334,6 @@ dependencies:
|
|
364
334
|
type: :development
|
365
335
|
prerelease: false
|
366
336
|
version_requirements: !ruby/object:Gem::Requirement
|
367
|
-
none: false
|
368
337
|
requirements:
|
369
338
|
- - ! '>='
|
370
339
|
- !ruby/object:Gem::Version
|
@@ -372,19 +341,17 @@ dependencies:
|
|
372
341
|
- !ruby/object:Gem::Dependency
|
373
342
|
name: actionmailer
|
374
343
|
requirement: !ruby/object:Gem::Requirement
|
375
|
-
none: false
|
376
344
|
requirements:
|
377
345
|
- - ! '>='
|
378
346
|
- !ruby/object:Gem::Version
|
379
|
-
version:
|
347
|
+
version: 3.0.0
|
380
348
|
type: :development
|
381
349
|
prerelease: false
|
382
350
|
version_requirements: !ruby/object:Gem::Requirement
|
383
|
-
none: false
|
384
351
|
requirements:
|
385
352
|
- - ! '>='
|
386
353
|
- !ruby/object:Gem::Version
|
387
|
-
version:
|
354
|
+
version: 3.0.0
|
388
355
|
description: Easy upload management for ActiveRecord
|
389
356
|
email:
|
390
357
|
- jyurek@thoughtbot.com
|
@@ -429,21 +396,23 @@ files:
|
|
429
396
|
- lib/generators/paperclip/templates/paperclip_migration.rb.erb
|
430
397
|
- lib/paperclip.rb
|
431
398
|
- lib/paperclip/attachment.rb
|
432
|
-
- lib/paperclip/attachment_options.rb
|
433
399
|
- lib/paperclip/callbacks.rb
|
434
400
|
- lib/paperclip/content_type_detector.rb
|
435
401
|
- lib/paperclip/errors.rb
|
436
402
|
- lib/paperclip/file_command_content_type_detector.rb
|
403
|
+
- lib/paperclip/filename_cleaner.rb
|
437
404
|
- lib/paperclip/geometry.rb
|
438
405
|
- lib/paperclip/geometry_detector_factory.rb
|
439
406
|
- lib/paperclip/geometry_parser_factory.rb
|
440
407
|
- lib/paperclip/glue.rb
|
408
|
+
- lib/paperclip/has_attached_file.rb
|
441
409
|
- lib/paperclip/helpers.rb
|
442
|
-
- lib/paperclip/instance_methods.rb
|
443
410
|
- lib/paperclip/interpolations.rb
|
444
411
|
- lib/paperclip/interpolations/plural_cache.rb
|
445
412
|
- lib/paperclip/io_adapters/abstract_adapter.rb
|
446
413
|
- lib/paperclip/io_adapters/attachment_adapter.rb
|
414
|
+
- lib/paperclip/io_adapters/data_uri_adapter.rb
|
415
|
+
- lib/paperclip/io_adapters/empty_string_adapter.rb
|
447
416
|
- lib/paperclip/io_adapters/file_adapter.rb
|
448
417
|
- lib/paperclip/io_adapters/identity_adapter.rb
|
449
418
|
- lib/paperclip/io_adapters/nil_adapter.rb
|
@@ -467,6 +436,7 @@ files:
|
|
467
436
|
- lib/paperclip/storage/fog.rb
|
468
437
|
- lib/paperclip/storage/s3.rb
|
469
438
|
- lib/paperclip/style.rb
|
439
|
+
- lib/paperclip/tasks/attachments.rb
|
470
440
|
- lib/paperclip/tempfile.rb
|
471
441
|
- lib/paperclip/tempfile_factory.rb
|
472
442
|
- lib/paperclip/thumbnail.rb
|
@@ -479,12 +449,12 @@ files:
|
|
479
449
|
- lib/tasks/paperclip.rake
|
480
450
|
- paperclip.gemspec
|
481
451
|
- shoulda_macros/paperclip.rb
|
482
|
-
- test/attachment_options_test.rb
|
483
452
|
- test/attachment_processing_test.rb
|
484
453
|
- test/attachment_test.rb
|
485
454
|
- test/content_type_detector_test.rb
|
486
455
|
- test/database.yml
|
487
456
|
- test/file_command_content_type_detector_test.rb
|
457
|
+
- test/filename_cleaner_test.rb
|
488
458
|
- test/fixtures/12k.png
|
489
459
|
- test/fixtures/50x50.png
|
490
460
|
- test/fixtures/5k.png
|
@@ -503,11 +473,14 @@ files:
|
|
503
473
|
- test/geometry_detector_test.rb
|
504
474
|
- test/geometry_parser_test.rb
|
505
475
|
- test/geometry_test.rb
|
476
|
+
- test/has_attached_file_test.rb
|
506
477
|
- test/helper.rb
|
507
478
|
- test/integration_test.rb
|
508
479
|
- test/interpolations_test.rb
|
509
480
|
- test/io_adapters/abstract_adapter_test.rb
|
510
481
|
- test/io_adapters/attachment_adapter_test.rb
|
482
|
+
- test/io_adapters/data_uri_adapter_test.rb
|
483
|
+
- test/io_adapters/empty_string_adapter_test.rb
|
511
484
|
- test/io_adapters/file_adapter_test.rb
|
512
485
|
- test/io_adapters/identity_adapter_test.rb
|
513
486
|
- test/io_adapters/nil_adapter_test.rb
|
@@ -524,6 +497,7 @@ files:
|
|
524
497
|
- test/paperclip_test.rb
|
525
498
|
- test/plural_cache_test.rb
|
526
499
|
- test/processor_test.rb
|
500
|
+
- test/rake_test.rb
|
527
501
|
- test/schema_test.rb
|
528
502
|
- test/storage/filesystem_test.rb
|
529
503
|
- test/storage/fog_test.rb
|
@@ -534,6 +508,7 @@ files:
|
|
534
508
|
- test/support/mock_interpolator.rb
|
535
509
|
- test/support/mock_model.rb
|
536
510
|
- test/support/mock_url_generator_builder.rb
|
511
|
+
- test/tasks/attachments_test.rb
|
537
512
|
- test/tempfile_factory_test.rb
|
538
513
|
- test/thumbnail_test.rb
|
539
514
|
- test/url_generator_test.rb
|
@@ -543,6 +518,7 @@ files:
|
|
543
518
|
- test/validators_test.rb
|
544
519
|
homepage: https://github.com/thoughtbot/paperclip
|
545
520
|
licenses: []
|
521
|
+
metadata: {}
|
546
522
|
post_install_message: ! "##################################################\n# NOTE
|
547
523
|
FOR UPGRADING FROM PRE-3.0 VERSION #\n##################################################\n\nPaperclip
|
548
524
|
3.0 introduces a non-backward compatible change in your attachment\npath. This will
|
@@ -555,13 +531,11 @@ rdoc_options: []
|
|
555
531
|
require_paths:
|
556
532
|
- lib
|
557
533
|
required_ruby_version: !ruby/object:Gem::Requirement
|
558
|
-
none: false
|
559
534
|
requirements:
|
560
535
|
- - ! '>='
|
561
536
|
- !ruby/object:Gem::Version
|
562
537
|
version: 1.9.2
|
563
538
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
564
|
-
none: false
|
565
539
|
requirements:
|
566
540
|
- - ! '>='
|
567
541
|
- !ruby/object:Gem::Version
|
@@ -569,9 +543,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
569
543
|
requirements:
|
570
544
|
- ImageMagick
|
571
545
|
rubyforge_project: paperclip
|
572
|
-
rubygems_version:
|
546
|
+
rubygems_version: 2.0.5
|
573
547
|
signing_key:
|
574
|
-
specification_version:
|
548
|
+
specification_version: 4
|
575
549
|
summary: File attachments as attributes for ActiveRecord
|
576
550
|
test_files:
|
577
551
|
- features/basic_integration.feature
|
@@ -591,12 +565,12 @@ test_files:
|
|
591
565
|
- features/support/paths.rb
|
592
566
|
- features/support/rails.rb
|
593
567
|
- features/support/selectors.rb
|
594
|
-
- test/attachment_options_test.rb
|
595
568
|
- test/attachment_processing_test.rb
|
596
569
|
- test/attachment_test.rb
|
597
570
|
- test/content_type_detector_test.rb
|
598
571
|
- test/database.yml
|
599
572
|
- test/file_command_content_type_detector_test.rb
|
573
|
+
- test/filename_cleaner_test.rb
|
600
574
|
- test/fixtures/12k.png
|
601
575
|
- test/fixtures/50x50.png
|
602
576
|
- test/fixtures/5k.png
|
@@ -615,11 +589,14 @@ test_files:
|
|
615
589
|
- test/geometry_detector_test.rb
|
616
590
|
- test/geometry_parser_test.rb
|
617
591
|
- test/geometry_test.rb
|
592
|
+
- test/has_attached_file_test.rb
|
618
593
|
- test/helper.rb
|
619
594
|
- test/integration_test.rb
|
620
595
|
- test/interpolations_test.rb
|
621
596
|
- test/io_adapters/abstract_adapter_test.rb
|
622
597
|
- test/io_adapters/attachment_adapter_test.rb
|
598
|
+
- test/io_adapters/data_uri_adapter_test.rb
|
599
|
+
- test/io_adapters/empty_string_adapter_test.rb
|
623
600
|
- test/io_adapters/file_adapter_test.rb
|
624
601
|
- test/io_adapters/identity_adapter_test.rb
|
625
602
|
- test/io_adapters/nil_adapter_test.rb
|
@@ -636,6 +613,7 @@ test_files:
|
|
636
613
|
- test/paperclip_test.rb
|
637
614
|
- test/plural_cache_test.rb
|
638
615
|
- test/processor_test.rb
|
616
|
+
- test/rake_test.rb
|
639
617
|
- test/schema_test.rb
|
640
618
|
- test/storage/filesystem_test.rb
|
641
619
|
- test/storage/fog_test.rb
|
@@ -646,6 +624,7 @@ test_files:
|
|
646
624
|
- test/support/mock_interpolator.rb
|
647
625
|
- test/support/mock_model.rb
|
648
626
|
- test/support/mock_url_generator_builder.rb
|
627
|
+
- test/tasks/attachments_test.rb
|
649
628
|
- test/tempfile_factory_test.rb
|
650
629
|
- test/thumbnail_test.rb
|
651
630
|
- test/url_generator_test.rb
|