paperclip 3.3.1 → 3.4.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.
- data/.gitignore +2 -1
- data/.travis.yml +2 -0
- data/NEWS +1 -0
- data/README.md +1 -1
- data/lib/generators/paperclip/templates/paperclip_migration.rb.erb +1 -1
- data/lib/paperclip.rb +4 -1
- data/lib/paperclip/attachment.rb +27 -6
- data/lib/paperclip/callbacks.rb +2 -2
- data/lib/paperclip/content_type_detector.rb +1 -12
- data/lib/paperclip/file_command_content_type_detector.rb +32 -0
- data/lib/paperclip/geometry.rb +33 -30
- data/lib/paperclip/geometry_detector_factory.rb +41 -0
- data/lib/paperclip/geometry_parser_factory.rb +31 -0
- data/lib/paperclip/helpers.rb +7 -7
- data/lib/paperclip/io_adapters/uploaded_file_adapter.rb +17 -1
- data/lib/paperclip/io_adapters/uri_adapter.rb +1 -0
- data/lib/paperclip/storage/filesystem.rb +11 -2
- data/lib/paperclip/storage/fog.rb +28 -13
- data/lib/paperclip/storage/s3.rb +39 -18
- data/lib/paperclip/thumbnail.rb +3 -0
- data/lib/paperclip/validators/attachment_content_type_validator.rb +29 -8
- data/lib/paperclip/version.rb +1 -1
- data/paperclip.gemspec +1 -1
- data/test/attachment_processing_test.rb +29 -0
- data/test/attachment_test.rb +97 -11
- data/test/file_command_content_type_detector_test.rb +25 -0
- data/test/generator_test.rb +3 -3
- data/test/geometry_detector_test.rb +24 -0
- data/test/geometry_parser_test.rb +73 -0
- data/test/geometry_test.rb +39 -7
- data/test/helper.rb +5 -1
- data/test/integration_test.rb +46 -1
- data/test/io_adapters/uploaded_file_adapter_test.rb +28 -4
- data/test/io_adapters/uri_adapter_test.rb +4 -0
- data/test/paperclip_test.rb +17 -7
- data/test/storage/fog_test.rb +66 -7
- data/test/storage/s3_test.rb +1 -1
- data/test/style_test.rb +18 -14
- data/test/thumbnail_test.rb +10 -56
- data/test/validators/attachment_content_type_validator_test.rb +155 -55
- metadata +137 -127
data/test/storage/s3_test.rb
CHANGED
@@ -924,7 +924,7 @@ class S3Test < Test::Unit::TestCase
|
|
924
924
|
object.expects(:write).with(anything,
|
925
925
|
:content_type => "image/png",
|
926
926
|
:acl => :public_read,
|
927
|
-
|
927
|
+
:server_side_encryption => 'AES256')
|
928
928
|
@dummy.save
|
929
929
|
end
|
930
930
|
|
data/test/style_test.rb
CHANGED
@@ -96,40 +96,44 @@ class StyleTest < Test::Unit::TestCase
|
|
96
96
|
end
|
97
97
|
|
98
98
|
context "An attachment with :convert_options" do
|
99
|
-
|
99
|
+
should "not have called extra_options_for(:thumb/:large) on initialization" do
|
100
100
|
@attachment = attachment :path => ":basename.:extension",
|
101
101
|
:styles => {:thumb => "100x100", :large => "400x400"},
|
102
102
|
:convert_options => {:all => "-do_stuff", :thumb => "-thumbnailize"}
|
103
|
-
@style = @attachment.styles[:thumb]
|
104
|
-
@file = StringIO.new("...")
|
105
|
-
@file.stubs(:original_filename).returns("file.jpg")
|
106
|
-
end
|
107
|
-
|
108
|
-
before_should "not have called extra_options_for(:thumb/:large) on initialization" do
|
109
103
|
@attachment.expects(:extra_options_for).never
|
104
|
+
@style = @attachment.styles[:thumb]
|
110
105
|
end
|
111
106
|
|
112
107
|
should "call extra_options_for(:thumb/:large) when convert options are requested" do
|
108
|
+
@attachment = attachment :path => ":basename.:extension",
|
109
|
+
:styles => {:thumb => "100x100", :large => "400x400"},
|
110
|
+
:convert_options => {:all => "-do_stuff", :thumb => "-thumbnailize"}
|
111
|
+
@style = @attachment.styles[:thumb]
|
112
|
+
@file = StringIO.new("...")
|
113
|
+
@file.stubs(:original_filename).returns("file.jpg")
|
114
|
+
|
113
115
|
@attachment.expects(:extra_options_for).with(:thumb)
|
114
116
|
@attachment.styles[:thumb].convert_options
|
115
117
|
end
|
116
118
|
end
|
117
119
|
|
118
120
|
context "An attachment with :source_file_options" do
|
119
|
-
|
121
|
+
should "not have called extra_source_file_options_for(:thumb/:large) on initialization" do
|
120
122
|
@attachment = attachment :path => ":basename.:extension",
|
121
123
|
:styles => {:thumb => "100x100", :large => "400x400"},
|
122
124
|
:source_file_options => {:all => "-density 400", :thumb => "-depth 8"}
|
123
|
-
@style = @attachment.styles[:thumb]
|
124
|
-
@file = StringIO.new("...")
|
125
|
-
@file.stubs(:original_filename).returns("file.jpg")
|
126
|
-
end
|
127
|
-
|
128
|
-
before_should "not have called extra_source_file_options_for(:thumb/:large) on initialization" do
|
129
125
|
@attachment.expects(:extra_source_file_options_for).never
|
126
|
+
@style = @attachment.styles[:thumb]
|
130
127
|
end
|
131
128
|
|
132
129
|
should "call extra_options_for(:thumb/:large) when convert options are requested" do
|
130
|
+
@attachment = attachment :path => ":basename.:extension",
|
131
|
+
:styles => {:thumb => "100x100", :large => "400x400"},
|
132
|
+
:source_file_options => {:all => "-density 400", :thumb => "-depth 8"}
|
133
|
+
@style = @attachment.styles[:thumb]
|
134
|
+
@file = StringIO.new("...")
|
135
|
+
@file.stubs(:original_filename).returns("file.jpg")
|
136
|
+
|
133
137
|
@attachment.expects(:extra_source_file_options_for).with(:thumb)
|
134
138
|
@attachment.styles[:thumb].source_file_options
|
135
139
|
end
|
data/test/thumbnail_test.rb
CHANGED
@@ -128,6 +128,16 @@ class ThumbnailTest < Test::Unit::TestCase
|
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
131
|
+
should 'properly crop a EXIF-rotated image' do
|
132
|
+
file = File.new(fixture_file('rotated.jpg'))
|
133
|
+
thumb = Paperclip::Thumbnail.new(file, :geometry => "50x50#")
|
134
|
+
|
135
|
+
output_file = thumb.make
|
136
|
+
|
137
|
+
command = Cocaine::CommandLine.new("identify", "-format %wx%h :file")
|
138
|
+
assert_equal "50x50", command.run(:file => output_file.path).strip
|
139
|
+
end
|
140
|
+
|
131
141
|
context "being thumbnailed with source file options set" do
|
132
142
|
setup do
|
133
143
|
@thumb = Paperclip::Thumbnail.new(@file,
|
@@ -306,62 +316,6 @@ class ThumbnailTest < Test::Unit::TestCase
|
|
306
316
|
end
|
307
317
|
end
|
308
318
|
|
309
|
-
context "An image with exif orientation" do
|
310
|
-
setup do
|
311
|
-
@file = File.new(fixture_file("rotated.jpg"), 'rb')
|
312
|
-
end
|
313
|
-
|
314
|
-
teardown { @file.close }
|
315
|
-
|
316
|
-
context "With :auto_orient => false" do
|
317
|
-
setup do
|
318
|
-
@thumb = Paperclip::Thumbnail.new(@file, :geometry => "100x50", :auto_orient => false)
|
319
|
-
end
|
320
|
-
|
321
|
-
should "send the right command to convert when sent #make" do
|
322
|
-
@thumb.expects(:convert).with do |*arg|
|
323
|
-
arg[0] == ':source -resize "100x50" :dest' &&
|
324
|
-
arg[1][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
|
325
|
-
end
|
326
|
-
@thumb.make
|
327
|
-
end
|
328
|
-
|
329
|
-
should "create the thumbnail when sent #make" do
|
330
|
-
dst = @thumb.make
|
331
|
-
assert_match /75x50/, `identify "#{dst.path}"`
|
332
|
-
end
|
333
|
-
|
334
|
-
should "not touch the orientation information" do
|
335
|
-
dst = @thumb.make
|
336
|
-
assert_match /exif:Orientation=6/, `identify -format "%[EXIF:*]" "#{dst.path}"`
|
337
|
-
end
|
338
|
-
end
|
339
|
-
|
340
|
-
context "Without :auto_orient => false" do
|
341
|
-
setup do
|
342
|
-
@thumb = Paperclip::Thumbnail.new(@file, :geometry => "100x50")
|
343
|
-
end
|
344
|
-
|
345
|
-
should "send the right command to convert when sent #make" do
|
346
|
-
@thumb.expects(:convert).with do |*arg|
|
347
|
-
arg[0] == ':source -auto-orient -resize "100x50" :dest' &&
|
348
|
-
arg[1][:source] == "#{File.expand_path(@thumb.file.path)}[0]"
|
349
|
-
end
|
350
|
-
@thumb.make
|
351
|
-
end
|
352
|
-
|
353
|
-
should "create the thumbnail when sent #make" do
|
354
|
-
dst = @thumb.make
|
355
|
-
assert_match /33x50/, `identify "#{dst.path}"`
|
356
|
-
end
|
357
|
-
|
358
|
-
should "remove the orientation information" do
|
359
|
-
dst = @thumb.make
|
360
|
-
assert_match /exif:Orientation=1/, `identify -format "%[EXIF:*]" "#{dst.path}"`
|
361
|
-
end
|
362
|
-
end
|
363
|
-
end
|
364
|
-
|
365
319
|
context "A multipage PDF" do
|
366
320
|
setup do
|
367
321
|
@file = File.new(fixture_file("twopage.pdf"), 'rb')
|
@@ -76,93 +76,189 @@ class AttachmentContentTypeValidatorTest < Test::Unit::TestCase
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
-
context "
|
80
|
-
context "
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
79
|
+
context "whitelist format" do
|
80
|
+
context "with an allowed type" do
|
81
|
+
context "as a string" do
|
82
|
+
setup do
|
83
|
+
build_validator :content_type => "image/jpg"
|
84
|
+
@dummy.stubs(:avatar_content_type => "image/jpg")
|
85
|
+
@validator.validate(@dummy)
|
86
|
+
end
|
86
87
|
|
87
|
-
|
88
|
-
|
88
|
+
should "not set an error message" do
|
89
|
+
assert @dummy.errors[:avatar_content_type].blank?
|
90
|
+
end
|
89
91
|
end
|
90
|
-
end
|
91
92
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
93
|
+
context "as an regexp" do
|
94
|
+
setup do
|
95
|
+
build_validator :content_type => /^image\/.*/
|
96
|
+
@dummy.stubs(:avatar_content_type => "image/jpg")
|
97
|
+
@validator.validate(@dummy)
|
98
|
+
end
|
99
|
+
|
100
|
+
should "not set an error message" do
|
101
|
+
assert @dummy.errors[:avatar_content_type].blank?
|
102
|
+
end
|
97
103
|
end
|
98
104
|
|
99
|
-
|
100
|
-
|
105
|
+
context "as a list" do
|
106
|
+
setup do
|
107
|
+
build_validator :content_type => ["image/png", "image/jpg", "image/jpeg"]
|
108
|
+
@dummy.stubs(:avatar_content_type => "image/jpg")
|
109
|
+
@validator.validate(@dummy)
|
110
|
+
end
|
111
|
+
|
112
|
+
should "not set an error message" do
|
113
|
+
assert @dummy.errors[:avatar_content_type].blank?
|
114
|
+
end
|
101
115
|
end
|
102
116
|
end
|
103
117
|
|
104
|
-
context "
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
118
|
+
context "with a disallowed type" do
|
119
|
+
context "as a string" do
|
120
|
+
setup do
|
121
|
+
build_validator :content_type => "image/png"
|
122
|
+
@dummy.stubs(:avatar_content_type => "image/jpg")
|
123
|
+
@validator.validate(@dummy)
|
124
|
+
end
|
125
|
+
|
126
|
+
should "set a correct default error message" do
|
127
|
+
assert @dummy.errors[:avatar_content_type].present?
|
128
|
+
assert_includes @dummy.errors[:avatar_content_type], "is invalid"
|
129
|
+
end
|
109
130
|
end
|
110
131
|
|
111
|
-
|
112
|
-
|
132
|
+
context "as a regexp" do
|
133
|
+
setup do
|
134
|
+
build_validator :content_type => /^text\/.*/
|
135
|
+
@dummy.stubs(:avatar_content_type => "image/jpg")
|
136
|
+
@validator.validate(@dummy)
|
137
|
+
end
|
138
|
+
|
139
|
+
should "set a correct default error message" do
|
140
|
+
assert @dummy.errors[:avatar_content_type].present?
|
141
|
+
assert_includes @dummy.errors[:avatar_content_type], "is invalid"
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
context "with :message option" do
|
146
|
+
context "without interpolation" do
|
147
|
+
setup do
|
148
|
+
build_validator :content_type => "image/png", :message => "should be a PNG image"
|
149
|
+
@dummy.stubs(:avatar_content_type => "image/jpg")
|
150
|
+
@validator.validate(@dummy)
|
151
|
+
end
|
152
|
+
|
153
|
+
should "set a correct error message" do
|
154
|
+
assert_includes @dummy.errors[:avatar_content_type], "should be a PNG image"
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
context "with interpolation" do
|
159
|
+
setup do
|
160
|
+
build_validator :content_type => "image/png", :message => "should have content type %{types}"
|
161
|
+
@dummy.stubs(:avatar_content_type => "image/jpg")
|
162
|
+
@validator.validate(@dummy)
|
163
|
+
end
|
164
|
+
|
165
|
+
should "set a correct error message" do
|
166
|
+
assert_includes @dummy.errors[:avatar_content_type], "should have content type image/png"
|
167
|
+
end
|
168
|
+
end
|
113
169
|
end
|
114
170
|
end
|
115
171
|
end
|
116
172
|
|
117
|
-
context "
|
118
|
-
context "
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
173
|
+
context "blacklist format" do
|
174
|
+
context "with an allowed type" do
|
175
|
+
context "as a string" do
|
176
|
+
setup do
|
177
|
+
build_validator :not => "image/gif"
|
178
|
+
@dummy.stubs(:avatar_content_type => "image/jpg")
|
179
|
+
@validator.validate(@dummy)
|
180
|
+
end
|
124
181
|
|
125
|
-
|
126
|
-
|
127
|
-
|
182
|
+
should "not set an error message" do
|
183
|
+
assert @dummy.errors[:avatar_content_type].blank?
|
184
|
+
end
|
128
185
|
end
|
129
|
-
end
|
130
186
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
187
|
+
context "as an regexp" do
|
188
|
+
setup do
|
189
|
+
build_validator :not => /^text\/.*/
|
190
|
+
@dummy.stubs(:avatar_content_type => "image/jpg")
|
191
|
+
@validator.validate(@dummy)
|
192
|
+
end
|
193
|
+
|
194
|
+
should "not set an error message" do
|
195
|
+
assert @dummy.errors[:avatar_content_type].blank?
|
196
|
+
end
|
136
197
|
end
|
137
198
|
|
138
|
-
|
139
|
-
|
140
|
-
|
199
|
+
context "as a list" do
|
200
|
+
setup do
|
201
|
+
build_validator :not => ["image/png", "image/jpg", "image/jpeg"]
|
202
|
+
@dummy.stubs(:avatar_content_type => "image/gif")
|
203
|
+
@validator.validate(@dummy)
|
204
|
+
end
|
205
|
+
|
206
|
+
should "not set an error message" do
|
207
|
+
assert @dummy.errors[:avatar_content_type].blank?
|
208
|
+
end
|
141
209
|
end
|
142
210
|
end
|
143
211
|
|
144
|
-
context "with
|
145
|
-
context "
|
212
|
+
context "with a disallowed type" do
|
213
|
+
context "as a string" do
|
146
214
|
setup do
|
147
|
-
build_validator :
|
148
|
-
@dummy.stubs(:avatar_content_type => "image/
|
215
|
+
build_validator :not => "image/png"
|
216
|
+
@dummy.stubs(:avatar_content_type => "image/png")
|
149
217
|
@validator.validate(@dummy)
|
150
218
|
end
|
151
219
|
|
152
|
-
should "set a correct error message" do
|
153
|
-
|
220
|
+
should "set a correct default error message" do
|
221
|
+
assert @dummy.errors[:avatar_content_type].present?
|
222
|
+
assert_includes @dummy.errors[:avatar_content_type], "is invalid"
|
154
223
|
end
|
155
224
|
end
|
156
225
|
|
157
|
-
context "
|
226
|
+
context "as a regexp" do
|
158
227
|
setup do
|
159
|
-
build_validator :
|
160
|
-
@dummy.stubs(:avatar_content_type => "
|
228
|
+
build_validator :not => /^text\/.*/
|
229
|
+
@dummy.stubs(:avatar_content_type => "text/plain")
|
161
230
|
@validator.validate(@dummy)
|
162
231
|
end
|
163
232
|
|
164
|
-
should "set a correct error message" do
|
165
|
-
|
233
|
+
should "set a correct default error message" do
|
234
|
+
assert @dummy.errors[:avatar_content_type].present?
|
235
|
+
assert_includes @dummy.errors[:avatar_content_type], "is invalid"
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
context "with :message option" do
|
240
|
+
context "without interpolation" do
|
241
|
+
setup do
|
242
|
+
build_validator :not => "image/png", :message => "should not be a PNG image"
|
243
|
+
@dummy.stubs(:avatar_content_type => "image/png")
|
244
|
+
@validator.validate(@dummy)
|
245
|
+
end
|
246
|
+
|
247
|
+
should "set a correct error message" do
|
248
|
+
assert_includes @dummy.errors[:avatar_content_type], "should not be a PNG image"
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
context "with interpolation" do
|
253
|
+
setup do
|
254
|
+
build_validator :not => "image/png", :message => "should not have content type %{types}"
|
255
|
+
@dummy.stubs(:avatar_content_type => "image/png")
|
256
|
+
@validator.validate(@dummy)
|
257
|
+
end
|
258
|
+
|
259
|
+
should "set a correct error message" do
|
260
|
+
assert_includes @dummy.errors[:avatar_content_type], "should not have content type image/png"
|
261
|
+
end
|
166
262
|
end
|
167
263
|
end
|
168
264
|
end
|
@@ -185,8 +281,12 @@ class AttachmentContentTypeValidatorTest < Test::Unit::TestCase
|
|
185
281
|
end
|
186
282
|
end
|
187
283
|
|
188
|
-
should "not raise
|
284
|
+
should "not raise argument error if :content_type was given" do
|
189
285
|
build_validator :content_type => "image/jpg"
|
190
286
|
end
|
287
|
+
|
288
|
+
should "not raise argument error if :not was given" do
|
289
|
+
build_validator :not => "image/jpg"
|
290
|
+
end
|
191
291
|
end
|
192
292
|
end
|
metadata
CHANGED
@@ -1,292 +1,290 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.3.1
|
5
4
|
prerelease:
|
5
|
+
version: 3.4.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jon Yurek
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 3.0.0
|
20
|
+
none: false
|
21
|
+
name: activerecord
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
|
25
|
-
none: false
|
24
|
+
requirement: !ruby/object:Gem::Requirement
|
26
25
|
requirements:
|
27
26
|
- - ! '>='
|
28
27
|
- !ruby/object:Gem::Version
|
29
28
|
version: 3.0.0
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: activemodel
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
29
|
none: false
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
version_requirements: !ruby/object:Gem::Requirement
|
34
32
|
requirements:
|
35
33
|
- - ! '>='
|
36
34
|
- !ruby/object:Gem::Version
|
37
35
|
version: 3.0.0
|
36
|
+
none: false
|
37
|
+
name: activemodel
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
|
-
|
41
|
-
none: false
|
40
|
+
requirement: !ruby/object:Gem::Requirement
|
42
41
|
requirements:
|
43
42
|
- - ! '>='
|
44
43
|
- !ruby/object:Gem::Version
|
45
44
|
version: 3.0.0
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: activesupport
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
45
|
none: false
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
48
|
requirements:
|
51
49
|
- - ! '>='
|
52
50
|
- !ruby/object:Gem::Version
|
53
51
|
version: 3.0.0
|
52
|
+
none: false
|
53
|
+
name: activesupport
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
|
-
|
57
|
-
none: false
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
58
|
- - ! '>='
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: 3.0.0
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: cocaine
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
61
|
none: false
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
64
|
requirements:
|
67
65
|
- - ~>
|
68
66
|
- !ruby/object:Gem::Version
|
69
67
|
version: 0.4.0
|
68
|
+
none: false
|
69
|
+
name: cocaine
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
|
-
|
73
|
-
none: false
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
74
73
|
requirements:
|
75
74
|
- - ~>
|
76
75
|
- !ruby/object:Gem::Version
|
77
76
|
version: 0.4.0
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: mime-types
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
81
77
|
none: false
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
80
|
requirements:
|
83
81
|
- - ! '>='
|
84
82
|
- !ruby/object:Gem::Version
|
85
83
|
version: '0'
|
84
|
+
none: false
|
85
|
+
name: mime-types
|
86
86
|
type: :runtime
|
87
87
|
prerelease: false
|
88
|
-
|
89
|
-
none: false
|
88
|
+
requirement: !ruby/object:Gem::Requirement
|
90
89
|
requirements:
|
91
90
|
- - ! '>='
|
92
91
|
- !ruby/object:Gem::Version
|
93
92
|
version: '0'
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: shoulda
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
93
|
none: false
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
98
96
|
requirements:
|
99
97
|
- - ! '>='
|
100
98
|
- !ruby/object:Gem::Version
|
101
99
|
version: '0'
|
100
|
+
none: false
|
101
|
+
name: shoulda
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
|
-
|
105
|
-
none: false
|
104
|
+
requirement: !ruby/object:Gem::Requirement
|
106
105
|
requirements:
|
107
106
|
- - ! '>='
|
108
107
|
- !ruby/object:Gem::Version
|
109
108
|
version: '0'
|
110
|
-
- !ruby/object:Gem::Dependency
|
111
|
-
name: appraisal
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
113
109
|
none: false
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
version_requirements: !ruby/object:Gem::Requirement
|
114
112
|
requirements:
|
115
113
|
- - ! '>='
|
116
114
|
- !ruby/object:Gem::Version
|
117
115
|
version: '0'
|
116
|
+
none: false
|
117
|
+
name: appraisal
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
|
-
|
121
|
-
none: false
|
120
|
+
requirement: !ruby/object:Gem::Requirement
|
122
121
|
requirements:
|
123
122
|
- - ! '>='
|
124
123
|
- !ruby/object:Gem::Version
|
125
124
|
version: '0'
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: mocha
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
129
125
|
none: false
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
version_requirements: !ruby/object:Gem::Requirement
|
130
128
|
requirements:
|
131
129
|
- - ! '>='
|
132
130
|
- !ruby/object:Gem::Version
|
133
131
|
version: '0'
|
132
|
+
none: false
|
133
|
+
name: mocha
|
134
134
|
type: :development
|
135
135
|
prerelease: false
|
136
|
-
|
137
|
-
none: false
|
136
|
+
requirement: !ruby/object:Gem::Requirement
|
138
137
|
requirements:
|
139
138
|
- - ! '>='
|
140
139
|
- !ruby/object:Gem::Version
|
141
140
|
version: '0'
|
142
|
-
- !ruby/object:Gem::Dependency
|
143
|
-
name: aws-sdk
|
144
|
-
requirement: !ruby/object:Gem::Requirement
|
145
141
|
none: false
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
version_requirements: !ruby/object:Gem::Requirement
|
146
144
|
requirements:
|
147
145
|
- - ! '>='
|
148
146
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
147
|
+
version: 1.2.0
|
148
|
+
none: false
|
149
|
+
name: aws-sdk
|
150
150
|
type: :development
|
151
151
|
prerelease: false
|
152
|
-
|
153
|
-
none: false
|
152
|
+
requirement: !ruby/object:Gem::Requirement
|
154
153
|
requirements:
|
155
154
|
- - ! '>='
|
156
155
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
158
|
-
- !ruby/object:Gem::Dependency
|
159
|
-
name: bourne
|
160
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
+
version: 1.2.0
|
161
157
|
none: false
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
version_requirements: !ruby/object:Gem::Requirement
|
162
160
|
requirements:
|
163
161
|
- - ! '>='
|
164
162
|
- !ruby/object:Gem::Version
|
165
163
|
version: '0'
|
164
|
+
none: false
|
165
|
+
name: bourne
|
166
166
|
type: :development
|
167
167
|
prerelease: false
|
168
|
-
|
169
|
-
none: false
|
168
|
+
requirement: !ruby/object:Gem::Requirement
|
170
169
|
requirements:
|
171
170
|
- - ! '>='
|
172
171
|
- !ruby/object:Gem::Version
|
173
172
|
version: '0'
|
174
|
-
- !ruby/object:Gem::Dependency
|
175
|
-
name: sqlite3
|
176
|
-
requirement: !ruby/object:Gem::Requirement
|
177
173
|
none: false
|
174
|
+
- !ruby/object:Gem::Dependency
|
175
|
+
version_requirements: !ruby/object:Gem::Requirement
|
178
176
|
requirements:
|
179
177
|
- - ~>
|
180
178
|
- !ruby/object:Gem::Version
|
181
179
|
version: 1.3.4
|
180
|
+
none: false
|
181
|
+
name: sqlite3
|
182
182
|
type: :development
|
183
183
|
prerelease: false
|
184
|
-
|
185
|
-
none: false
|
184
|
+
requirement: !ruby/object:Gem::Requirement
|
186
185
|
requirements:
|
187
186
|
- - ~>
|
188
187
|
- !ruby/object:Gem::Version
|
189
188
|
version: 1.3.4
|
190
|
-
- !ruby/object:Gem::Dependency
|
191
|
-
name: cucumber
|
192
|
-
requirement: !ruby/object:Gem::Requirement
|
193
189
|
none: false
|
190
|
+
- !ruby/object:Gem::Dependency
|
191
|
+
version_requirements: !ruby/object:Gem::Requirement
|
194
192
|
requirements:
|
195
193
|
- - ~>
|
196
194
|
- !ruby/object:Gem::Version
|
197
195
|
version: 1.2.1
|
196
|
+
none: false
|
197
|
+
name: cucumber
|
198
198
|
type: :development
|
199
199
|
prerelease: false
|
200
|
-
|
201
|
-
none: false
|
200
|
+
requirement: !ruby/object:Gem::Requirement
|
202
201
|
requirements:
|
203
202
|
- - ~>
|
204
203
|
- !ruby/object:Gem::Version
|
205
204
|
version: 1.2.1
|
206
|
-
- !ruby/object:Gem::Dependency
|
207
|
-
name: aruba
|
208
|
-
requirement: !ruby/object:Gem::Requirement
|
209
205
|
none: false
|
206
|
+
- !ruby/object:Gem::Dependency
|
207
|
+
version_requirements: !ruby/object:Gem::Requirement
|
210
208
|
requirements:
|
211
209
|
- - ! '>='
|
212
210
|
- !ruby/object:Gem::Version
|
213
211
|
version: '0'
|
212
|
+
none: false
|
213
|
+
name: aruba
|
214
214
|
type: :development
|
215
215
|
prerelease: false
|
216
|
-
|
217
|
-
none: false
|
216
|
+
requirement: !ruby/object:Gem::Requirement
|
218
217
|
requirements:
|
219
218
|
- - ! '>='
|
220
219
|
- !ruby/object:Gem::Version
|
221
220
|
version: '0'
|
222
|
-
- !ruby/object:Gem::Dependency
|
223
|
-
name: nokogiri
|
224
|
-
requirement: !ruby/object:Gem::Requirement
|
225
221
|
none: false
|
222
|
+
- !ruby/object:Gem::Dependency
|
223
|
+
version_requirements: !ruby/object:Gem::Requirement
|
226
224
|
requirements:
|
227
225
|
- - ! '>='
|
228
226
|
- !ruby/object:Gem::Version
|
229
227
|
version: '0'
|
228
|
+
none: false
|
229
|
+
name: nokogiri
|
230
230
|
type: :development
|
231
231
|
prerelease: false
|
232
|
-
|
233
|
-
none: false
|
232
|
+
requirement: !ruby/object:Gem::Requirement
|
234
233
|
requirements:
|
235
234
|
- - ! '>='
|
236
235
|
- !ruby/object:Gem::Version
|
237
236
|
version: '0'
|
238
|
-
- !ruby/object:Gem::Dependency
|
239
|
-
name: capybara
|
240
|
-
requirement: !ruby/object:Gem::Requirement
|
241
237
|
none: false
|
238
|
+
- !ruby/object:Gem::Dependency
|
239
|
+
version_requirements: !ruby/object:Gem::Requirement
|
242
240
|
requirements:
|
243
241
|
- - ! '>='
|
244
242
|
- !ruby/object:Gem::Version
|
245
243
|
version: '0'
|
244
|
+
none: false
|
245
|
+
name: capybara
|
246
246
|
type: :development
|
247
247
|
prerelease: false
|
248
|
-
|
249
|
-
none: false
|
248
|
+
requirement: !ruby/object:Gem::Requirement
|
250
249
|
requirements:
|
251
250
|
- - ! '>='
|
252
251
|
- !ruby/object:Gem::Version
|
253
252
|
version: '0'
|
254
|
-
- !ruby/object:Gem::Dependency
|
255
|
-
name: bundler
|
256
|
-
requirement: !ruby/object:Gem::Requirement
|
257
253
|
none: false
|
254
|
+
- !ruby/object:Gem::Dependency
|
255
|
+
version_requirements: !ruby/object:Gem::Requirement
|
258
256
|
requirements:
|
259
257
|
- - ! '>='
|
260
258
|
- !ruby/object:Gem::Version
|
261
259
|
version: '0'
|
260
|
+
none: false
|
261
|
+
name: bundler
|
262
262
|
type: :development
|
263
263
|
prerelease: false
|
264
|
-
|
265
|
-
none: false
|
264
|
+
requirement: !ruby/object:Gem::Requirement
|
266
265
|
requirements:
|
267
266
|
- - ! '>='
|
268
267
|
- !ruby/object:Gem::Version
|
269
268
|
version: '0'
|
270
|
-
- !ruby/object:Gem::Dependency
|
271
|
-
name: cocaine
|
272
|
-
requirement: !ruby/object:Gem::Requirement
|
273
269
|
none: false
|
270
|
+
- !ruby/object:Gem::Dependency
|
271
|
+
version_requirements: !ruby/object:Gem::Requirement
|
274
272
|
requirements:
|
275
273
|
- - ~>
|
276
274
|
- !ruby/object:Gem::Version
|
277
275
|
version: '0.2'
|
276
|
+
none: false
|
277
|
+
name: cocaine
|
278
278
|
type: :development
|
279
279
|
prerelease: false
|
280
|
-
|
281
|
-
none: false
|
280
|
+
requirement: !ruby/object:Gem::Requirement
|
282
281
|
requirements:
|
283
282
|
- - ~>
|
284
283
|
- !ruby/object:Gem::Version
|
285
284
|
version: '0.2'
|
286
|
-
- !ruby/object:Gem::Dependency
|
287
|
-
name: fog
|
288
|
-
requirement: !ruby/object:Gem::Requirement
|
289
285
|
none: false
|
286
|
+
- !ruby/object:Gem::Dependency
|
287
|
+
version_requirements: !ruby/object:Gem::Requirement
|
290
288
|
requirements:
|
291
289
|
- - ! '>='
|
292
290
|
- !ruby/object:Gem::Version
|
@@ -294,10 +292,11 @@ dependencies:
|
|
294
292
|
- - <
|
295
293
|
- !ruby/object:Gem::Version
|
296
294
|
version: 1.7.0
|
295
|
+
none: false
|
296
|
+
name: fog
|
297
297
|
type: :development
|
298
298
|
prerelease: false
|
299
|
-
|
300
|
-
none: false
|
299
|
+
requirement: !ruby/object:Gem::Requirement
|
301
300
|
requirements:
|
302
301
|
- - ! '>='
|
303
302
|
- !ruby/object:Gem::Version
|
@@ -305,102 +304,103 @@ dependencies:
|
|
305
304
|
- - <
|
306
305
|
- !ruby/object:Gem::Version
|
307
306
|
version: 1.7.0
|
308
|
-
- !ruby/object:Gem::Dependency
|
309
|
-
name: pry
|
310
|
-
requirement: !ruby/object:Gem::Requirement
|
311
307
|
none: false
|
308
|
+
- !ruby/object:Gem::Dependency
|
309
|
+
version_requirements: !ruby/object:Gem::Requirement
|
312
310
|
requirements:
|
313
311
|
- - ! '>='
|
314
312
|
- !ruby/object:Gem::Version
|
315
313
|
version: '0'
|
314
|
+
none: false
|
315
|
+
name: pry
|
316
316
|
type: :development
|
317
317
|
prerelease: false
|
318
|
-
|
319
|
-
none: false
|
318
|
+
requirement: !ruby/object:Gem::Requirement
|
320
319
|
requirements:
|
321
320
|
- - ! '>='
|
322
321
|
- !ruby/object:Gem::Version
|
323
322
|
version: '0'
|
324
|
-
- !ruby/object:Gem::Dependency
|
325
|
-
name: launchy
|
326
|
-
requirement: !ruby/object:Gem::Requirement
|
327
323
|
none: false
|
324
|
+
- !ruby/object:Gem::Dependency
|
325
|
+
version_requirements: !ruby/object:Gem::Requirement
|
328
326
|
requirements:
|
329
327
|
- - ! '>='
|
330
328
|
- !ruby/object:Gem::Version
|
331
329
|
version: '0'
|
330
|
+
none: false
|
331
|
+
name: launchy
|
332
332
|
type: :development
|
333
333
|
prerelease: false
|
334
|
-
|
335
|
-
none: false
|
334
|
+
requirement: !ruby/object:Gem::Requirement
|
336
335
|
requirements:
|
337
336
|
- - ! '>='
|
338
337
|
- !ruby/object:Gem::Version
|
339
338
|
version: '0'
|
340
|
-
- !ruby/object:Gem::Dependency
|
341
|
-
name: rake
|
342
|
-
requirement: !ruby/object:Gem::Requirement
|
343
339
|
none: false
|
340
|
+
- !ruby/object:Gem::Dependency
|
341
|
+
version_requirements: !ruby/object:Gem::Requirement
|
344
342
|
requirements:
|
345
343
|
- - ! '>='
|
346
344
|
- !ruby/object:Gem::Version
|
347
345
|
version: '0'
|
346
|
+
none: false
|
347
|
+
name: rake
|
348
348
|
type: :development
|
349
349
|
prerelease: false
|
350
|
-
|
351
|
-
none: false
|
350
|
+
requirement: !ruby/object:Gem::Requirement
|
352
351
|
requirements:
|
353
352
|
- - ! '>='
|
354
353
|
- !ruby/object:Gem::Version
|
355
354
|
version: '0'
|
356
|
-
- !ruby/object:Gem::Dependency
|
357
|
-
name: fakeweb
|
358
|
-
requirement: !ruby/object:Gem::Requirement
|
359
355
|
none: false
|
356
|
+
- !ruby/object:Gem::Dependency
|
357
|
+
version_requirements: !ruby/object:Gem::Requirement
|
360
358
|
requirements:
|
361
359
|
- - ! '>='
|
362
360
|
- !ruby/object:Gem::Version
|
363
361
|
version: '0'
|
362
|
+
none: false
|
363
|
+
name: fakeweb
|
364
364
|
type: :development
|
365
365
|
prerelease: false
|
366
|
-
|
367
|
-
none: false
|
366
|
+
requirement: !ruby/object:Gem::Requirement
|
368
367
|
requirements:
|
369
368
|
- - ! '>='
|
370
369
|
- !ruby/object:Gem::Version
|
371
370
|
version: '0'
|
372
|
-
- !ruby/object:Gem::Dependency
|
373
|
-
name: railties
|
374
|
-
requirement: !ruby/object:Gem::Requirement
|
375
371
|
none: false
|
372
|
+
- !ruby/object:Gem::Dependency
|
373
|
+
version_requirements: !ruby/object:Gem::Requirement
|
376
374
|
requirements:
|
377
375
|
- - ! '>='
|
378
376
|
- !ruby/object:Gem::Version
|
379
377
|
version: '0'
|
378
|
+
none: false
|
379
|
+
name: railties
|
380
380
|
type: :development
|
381
381
|
prerelease: false
|
382
|
-
|
383
|
-
none: false
|
382
|
+
requirement: !ruby/object:Gem::Requirement
|
384
383
|
requirements:
|
385
384
|
- - ! '>='
|
386
385
|
- !ruby/object:Gem::Version
|
387
386
|
version: '0'
|
388
|
-
- !ruby/object:Gem::Dependency
|
389
|
-
name: actionmailer
|
390
|
-
requirement: !ruby/object:Gem::Requirement
|
391
387
|
none: false
|
388
|
+
- !ruby/object:Gem::Dependency
|
389
|
+
version_requirements: !ruby/object:Gem::Requirement
|
392
390
|
requirements:
|
393
391
|
- - ! '>='
|
394
392
|
- !ruby/object:Gem::Version
|
395
393
|
version: '0'
|
394
|
+
none: false
|
395
|
+
name: actionmailer
|
396
396
|
type: :development
|
397
397
|
prerelease: false
|
398
|
-
|
399
|
-
none: false
|
398
|
+
requirement: !ruby/object:Gem::Requirement
|
400
399
|
requirements:
|
401
400
|
- - ! '>='
|
402
401
|
- !ruby/object:Gem::Version
|
403
402
|
version: '0'
|
403
|
+
none: false
|
404
404
|
description: Easy upload management for ActiveRecord
|
405
405
|
email:
|
406
406
|
- jyurek@thoughtbot.com
|
@@ -450,7 +450,10 @@ files:
|
|
450
450
|
- lib/paperclip/callbacks.rb
|
451
451
|
- lib/paperclip/content_type_detector.rb
|
452
452
|
- lib/paperclip/errors.rb
|
453
|
+
- lib/paperclip/file_command_content_type_detector.rb
|
453
454
|
- lib/paperclip/geometry.rb
|
455
|
+
- lib/paperclip/geometry_detector_factory.rb
|
456
|
+
- lib/paperclip/geometry_parser_factory.rb
|
454
457
|
- lib/paperclip/glue.rb
|
455
458
|
- lib/paperclip/helpers.rb
|
456
459
|
- lib/paperclip/instance_methods.rb
|
@@ -493,9 +496,11 @@ files:
|
|
493
496
|
- paperclip.gemspec
|
494
497
|
- shoulda_macros/paperclip.rb
|
495
498
|
- test/attachment_options_test.rb
|
499
|
+
- test/attachment_processing_test.rb
|
496
500
|
- test/attachment_test.rb
|
497
501
|
- test/content_type_detector_test.rb
|
498
502
|
- test/database.yml
|
503
|
+
- test/file_command_content_type_detector_test.rb
|
499
504
|
- test/fixtures/12k.png
|
500
505
|
- test/fixtures/50x50.png
|
501
506
|
- test/fixtures/5k.png
|
@@ -511,6 +516,8 @@ files:
|
|
511
516
|
- test/fixtures/twopage.pdf
|
512
517
|
- test/fixtures/uppercase.PNG
|
513
518
|
- test/generator_test.rb
|
519
|
+
- test/geometry_detector_test.rb
|
520
|
+
- test/geometry_parser_test.rb
|
514
521
|
- test/geometry_test.rb
|
515
522
|
- test/helper.rb
|
516
523
|
- test/integration_test.rb
|
@@ -563,17 +570,17 @@ rdoc_options: []
|
|
563
570
|
require_paths:
|
564
571
|
- lib
|
565
572
|
required_ruby_version: !ruby/object:Gem::Requirement
|
566
|
-
none: false
|
567
573
|
requirements:
|
568
574
|
- - ! '>='
|
569
575
|
- !ruby/object:Gem::Version
|
570
576
|
version: 1.9.2
|
571
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
572
577
|
none: false
|
578
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
573
579
|
requirements:
|
574
580
|
- - ! '>='
|
575
581
|
- !ruby/object:Gem::Version
|
576
582
|
version: '0'
|
583
|
+
none: false
|
577
584
|
requirements:
|
578
585
|
- ImageMagick
|
579
586
|
rubyforge_project: paperclip
|
@@ -600,9 +607,11 @@ test_files:
|
|
600
607
|
- features/support/rails.rb
|
601
608
|
- features/support/selectors.rb
|
602
609
|
- test/attachment_options_test.rb
|
610
|
+
- test/attachment_processing_test.rb
|
603
611
|
- test/attachment_test.rb
|
604
612
|
- test/content_type_detector_test.rb
|
605
613
|
- test/database.yml
|
614
|
+
- test/file_command_content_type_detector_test.rb
|
606
615
|
- test/fixtures/12k.png
|
607
616
|
- test/fixtures/50x50.png
|
608
617
|
- test/fixtures/5k.png
|
@@ -618,6 +627,8 @@ test_files:
|
|
618
627
|
- test/fixtures/twopage.pdf
|
619
628
|
- test/fixtures/uppercase.PNG
|
620
629
|
- test/generator_test.rb
|
630
|
+
- test/geometry_detector_test.rb
|
631
|
+
- test/geometry_parser_test.rb
|
621
632
|
- test/geometry_test.rb
|
622
633
|
- test/helper.rb
|
623
634
|
- test/integration_test.rb
|
@@ -656,4 +667,3 @@ test_files:
|
|
656
667
|
- test/validators/attachment_presence_validator_test.rb
|
657
668
|
- test/validators/attachment_size_validator_test.rb
|
658
669
|
- test/validators_test.rb
|
659
|
-
has_rdoc:
|