paperclip 4.3.0 → 5.0.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 +4 -4
- data/.travis.yml +14 -13
- data/Appraisals +22 -9
- data/CONTRIBUTING.md +16 -5
- data/Gemfile +2 -8
- data/LICENSE +1 -1
- data/NEWS +49 -2
- data/README.md +126 -102
- data/UPGRADING +12 -9
- data/features/basic_integration.feature +1 -0
- data/features/migration.feature +0 -24
- data/features/step_definitions/attachment_steps.rb +20 -20
- data/features/step_definitions/html_steps.rb +2 -2
- data/features/step_definitions/rails_steps.rb +11 -17
- data/features/step_definitions/s3_steps.rb +2 -2
- data/features/step_definitions/web_steps.rb +1 -103
- data/features/support/file_helpers.rb +2 -2
- data/gemfiles/4.2.awsv2.0.gemfile +17 -0
- data/gemfiles/4.2.awsv2.1.gemfile +17 -0
- data/gemfiles/{4.2.gemfile → 4.2.awsv2.gemfile} +1 -1
- data/gemfiles/5.0.awsv2.0.gemfile +17 -0
- data/gemfiles/5.0.awsv2.1.gemfile +17 -0
- data/gemfiles/{4.1.gemfile → 5.0.awsv2.gemfile} +2 -2
- data/lib/paperclip/attachment.rb +18 -17
- data/lib/paperclip/attachment_registry.rb +2 -1
- data/lib/paperclip/callbacks.rb +8 -6
- data/lib/paperclip/content_type_detector.rb +3 -2
- data/lib/paperclip/errors.rb +3 -1
- data/lib/paperclip/geometry_parser_factory.rb +1 -1
- data/lib/paperclip/glue.rb +1 -1
- data/lib/paperclip/has_attached_file.rb +7 -1
- data/lib/paperclip/helpers.rb +14 -10
- data/lib/paperclip/interpolations/plural_cache.rb +6 -5
- data/lib/paperclip/interpolations.rb +18 -13
- data/lib/paperclip/io_adapters/http_url_proxy_adapter.rb +1 -1
- data/lib/paperclip/io_adapters/uri_adapter.rb +3 -1
- data/lib/paperclip/matchers/validate_attachment_content_type_matcher.rb +4 -4
- data/lib/paperclip/media_type_spoof_detector.rb +1 -1
- data/lib/paperclip/rails_environment.rb +1 -1
- data/lib/paperclip/schema.rb +3 -9
- data/lib/paperclip/storage/fog.rb +17 -8
- data/lib/paperclip/storage/s3.rb +51 -49
- data/lib/paperclip/validators/attachment_size_validator.rb +1 -7
- data/lib/paperclip/version.rb +3 -1
- data/lib/paperclip.rb +2 -1
- data/lib/tasks/paperclip.rake +1 -1
- data/paperclip.gemspec +15 -11
- data/spec/paperclip/attachment_processing_spec.rb +2 -4
- data/spec/paperclip/attachment_registry_spec.rb +28 -0
- data/spec/paperclip/attachment_spec.rb +36 -14
- data/spec/paperclip/geometry_spec.rb +1 -1
- data/spec/paperclip/glue_spec.rb +44 -0
- data/spec/paperclip/has_attached_file_spec.rb +24 -8
- data/spec/paperclip/integration_spec.rb +4 -3
- data/spec/paperclip/interpolations_spec.rb +14 -4
- data/spec/paperclip/io_adapters/http_url_proxy_adapter_spec.rb +12 -0
- data/spec/paperclip/io_adapters/uri_adapter_spec.rb +27 -0
- data/spec/paperclip/matchers/validate_attachment_content_type_matcher_spec.rb +10 -0
- data/spec/paperclip/media_type_spoof_detector_spec.rb +12 -3
- data/spec/paperclip/paperclip_spec.rb +3 -28
- data/spec/paperclip/plural_cache_spec.rb +17 -16
- data/spec/paperclip/storage/fog_spec.rb +31 -1
- data/spec/paperclip/storage/s3_live_spec.rb +8 -4
- data/spec/paperclip/storage/s3_spec.rb +213 -156
- data/spec/paperclip/validators/attachment_size_validator_spec.rb +26 -20
- data/spec/paperclip/validators_spec.rb +3 -3
- data/spec/spec_helper.rb +6 -1
- data/spec/support/assertions.rb +7 -0
- data/spec/support/model_reconstruction.rb +9 -1
- data/spec/support/reporting.rb +11 -0
- metadata +74 -47
- data/cucumber/paperclip_steps.rb +0 -6
- data/gemfiles/3.2.gemfile +0 -20
- data/lib/paperclip/locales/de.yml +0 -18
- data/lib/paperclip/locales/es.yml +0 -18
- data/lib/paperclip/locales/ja.yml +0 -18
- data/lib/paperclip/locales/pt-BR.yml +0 -18
- data/lib/paperclip/locales/zh-CN.yml +0 -18
- data/lib/paperclip/locales/zh-HK.yml +0 -18
- data/lib/paperclip/locales/zh-TW.yml +0 -18
- data/spec/support/rails_helpers.rb +0 -7
@@ -12,14 +12,6 @@ describe Paperclip::Validators::AttachmentSizeValidator do
|
|
12
12
|
))
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.storage_units
|
16
|
-
if defined?(ActiveSupport::NumberHelper) # Rails 4.0+
|
17
|
-
{ 5120 => '5 KB', 10240 => '10 KB' }
|
18
|
-
else
|
19
|
-
{ 5120 => '5120 Bytes', 10240 => '10240 Bytes' }
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
15
|
def self.should_allow_attachment_file_size(size)
|
24
16
|
context "when the attachment size is #{size}" do
|
25
17
|
it "adds error to dummy object" do
|
@@ -158,8 +150,10 @@ describe Paperclip::Validators::AttachmentSizeValidator do
|
|
158
150
|
message: "is invalid. (Between %{min} and %{max} please.)"
|
159
151
|
end
|
160
152
|
|
161
|
-
should_not_allow_attachment_file_size
|
162
|
-
|
153
|
+
should_not_allow_attachment_file_size(
|
154
|
+
11.kilobytes,
|
155
|
+
message: "is invalid. (Between 5 KB and 10 KB please.)"
|
156
|
+
)
|
163
157
|
end
|
164
158
|
|
165
159
|
context "given :less_than and :greater_than" do
|
@@ -169,8 +163,10 @@ describe Paperclip::Validators::AttachmentSizeValidator do
|
|
169
163
|
message: "is invalid. (Between %{min} and %{max} please.)"
|
170
164
|
end
|
171
165
|
|
172
|
-
should_not_allow_attachment_file_size
|
173
|
-
|
166
|
+
should_not_allow_attachment_file_size(
|
167
|
+
11.kilobytes,
|
168
|
+
message: "is invalid. (Between 5 KB and 10 KB please.)"
|
169
|
+
)
|
174
170
|
end
|
175
171
|
end
|
176
172
|
|
@@ -181,10 +177,15 @@ describe Paperclip::Validators::AttachmentSizeValidator do
|
|
181
177
|
less_than: 10.kilobytes
|
182
178
|
end
|
183
179
|
|
184
|
-
should_not_allow_attachment_file_size
|
185
|
-
|
186
|
-
|
187
|
-
|
180
|
+
should_not_allow_attachment_file_size(
|
181
|
+
11.kilobytes,
|
182
|
+
message: "must be less than 10 KB"
|
183
|
+
)
|
184
|
+
|
185
|
+
should_not_allow_attachment_file_size(
|
186
|
+
4.kilobytes,
|
187
|
+
message: "must be greater than 5 KB"
|
188
|
+
)
|
188
189
|
end
|
189
190
|
|
190
191
|
context "given a size range" do
|
@@ -192,10 +193,15 @@ describe Paperclip::Validators::AttachmentSizeValidator do
|
|
192
193
|
build_validator in: (5.kilobytes..10.kilobytes)
|
193
194
|
end
|
194
195
|
|
195
|
-
should_not_allow_attachment_file_size
|
196
|
-
|
197
|
-
|
198
|
-
|
196
|
+
should_not_allow_attachment_file_size(
|
197
|
+
11.kilobytes,
|
198
|
+
message: "must be in between 5 KB and 10 KB"
|
199
|
+
)
|
200
|
+
|
201
|
+
should_not_allow_attachment_file_size(
|
202
|
+
4.kilobytes,
|
203
|
+
message: "must be in between 5 KB and 10 KB"
|
204
|
+
)
|
199
205
|
end
|
200
206
|
end
|
201
207
|
|
@@ -3,6 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe Paperclip::Validators do
|
4
4
|
context "using the helper" do
|
5
5
|
before do
|
6
|
+
rebuild_class
|
6
7
|
Dummy.validates_attachment :avatar, presence: true, content_type: { content_type: "image/jpeg" }, size: { in: 0..10240 }
|
7
8
|
end
|
8
9
|
|
@@ -64,12 +65,11 @@ describe Paperclip::Validators do
|
|
64
65
|
assert_raises(RuntimeError){ dummy.valid? }
|
65
66
|
end
|
66
67
|
|
67
|
-
it 'allows you to attach a file that does not
|
68
|
+
it 'allows you to attach a file that does not violate these validations' do
|
68
69
|
dummy = Dummy.new(avatar: File.new(fixture_file('rotated.jpg')))
|
69
|
-
expect(dummy.errors.
|
70
|
+
expect(dummy.errors.full_messages).to be_empty
|
70
71
|
assert dummy.valid?
|
71
72
|
end
|
72
|
-
|
73
73
|
end
|
74
74
|
|
75
75
|
context "using the helper with a conditional" do
|
data/spec/spec_helper.rb
CHANGED
@@ -7,6 +7,8 @@ require 'active_support/core_ext'
|
|
7
7
|
require 'mocha/api'
|
8
8
|
require 'bourne'
|
9
9
|
require 'ostruct'
|
10
|
+
require 'pathname'
|
11
|
+
require 'activerecord-import'
|
10
12
|
|
11
13
|
ROOT = Pathname(File.expand_path(File.join(File.dirname(__FILE__), '..')))
|
12
14
|
|
@@ -20,6 +22,9 @@ FIXTURES_DIR = File.join(File.dirname(__FILE__), "fixtures")
|
|
20
22
|
config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
|
21
23
|
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
|
22
24
|
ActiveRecord::Base.establish_connection(config['test'])
|
25
|
+
unless ActiveRecord::VERSION::STRING < "4.2"
|
26
|
+
ActiveRecord::Base.raise_in_transactional_callbacks = true
|
27
|
+
end
|
23
28
|
Paperclip.options[:logger] = ActiveRecord::Base.logger
|
24
29
|
|
25
30
|
Dir[File.join(ROOT, 'spec', 'support', '**', '*.rb')].each{|f| require f }
|
@@ -31,8 +36,8 @@ RSpec.configure do |config|
|
|
31
36
|
config.include Assertions
|
32
37
|
config.include ModelReconstruction
|
33
38
|
config.include TestData
|
39
|
+
config.include Reporting
|
34
40
|
config.extend VersionHelper
|
35
|
-
config.extend RailsHelpers::ClassMethods
|
36
41
|
config.mock_framework = :mocha
|
37
42
|
config.before(:all) do
|
38
43
|
rebuild_model
|
data/spec/support/assertions.rb
CHANGED
@@ -61,6 +61,13 @@ module Assertions
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
+
def assert_forbidden_response(url)
|
65
|
+
Net::HTTP.get_response(URI.parse(url)) do |response|
|
66
|
+
assert_equal "403", response.code,
|
67
|
+
"Expected HTTP response code 403, got #{response.code}"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
64
71
|
def assert_frame_dimensions(range, frames)
|
65
72
|
frames.each_with_index do |frame, frame_index|
|
66
73
|
frame.split('x').each_with_index do |dimension, dimension_index |
|
@@ -10,7 +10,15 @@ module ModelReconstruction
|
|
10
10
|
|
11
11
|
klass.reset_column_information
|
12
12
|
klass.connection_pool.clear_table_cache!(klass.table_name) if klass.connection_pool.respond_to?(:clear_table_cache!)
|
13
|
-
|
13
|
+
|
14
|
+
if klass.connection.respond_to?(:schema_cache)
|
15
|
+
if ActiveRecord::VERSION::STRING >= "5.0"
|
16
|
+
klass.connection.schema_cache.clear_data_source_cache!(klass.table_name)
|
17
|
+
else
|
18
|
+
klass.connection.schema_cache.clear_table_cache!(klass.table_name)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
14
22
|
klass
|
15
23
|
end
|
16
24
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Yurek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 4.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 4.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cocaine
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,14 +70,14 @@ dependencies:
|
|
70
70
|
name: mimemagic
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 0.3.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.3.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 4.2.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 4.2.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: shoulda
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,16 +112,16 @@ dependencies:
|
|
112
112
|
name: rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
117
|
+
version: '3.0'
|
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: '0'
|
124
|
+
version: '3.0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: appraisal
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,20 +156,20 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
160
|
-
- - "
|
159
|
+
version: 2.0.34
|
160
|
+
- - "<"
|
161
161
|
- !ruby/object:Gem::Version
|
162
|
-
version: '
|
162
|
+
version: '3.0'
|
163
163
|
type: :development
|
164
164
|
prerelease: false
|
165
165
|
version_requirements: !ruby/object:Gem::Requirement
|
166
166
|
requirements:
|
167
167
|
- - ">="
|
168
168
|
- !ruby/object:Gem::Version
|
169
|
-
version:
|
170
|
-
- - "
|
169
|
+
version: 2.0.34
|
170
|
+
- - "<"
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version: '
|
172
|
+
version: '3.0'
|
173
173
|
- !ruby/object:Gem::Dependency
|
174
174
|
name: bourne
|
175
175
|
requirement: !ruby/object:Gem::Requirement
|
@@ -200,6 +200,20 @@ dependencies:
|
|
200
200
|
version: 1.3.18
|
201
201
|
- !ruby/object:Gem::Dependency
|
202
202
|
name: aruba
|
203
|
+
requirement: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - "~>"
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: 0.9.0
|
208
|
+
type: :development
|
209
|
+
prerelease: false
|
210
|
+
version_requirements: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - "~>"
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: 0.9.0
|
215
|
+
- !ruby/object:Gem::Dependency
|
216
|
+
name: nokogiri
|
203
217
|
requirement: !ruby/object:Gem::Requirement
|
204
218
|
requirements:
|
205
219
|
- - ">="
|
@@ -213,7 +227,7 @@ dependencies:
|
|
213
227
|
- !ruby/object:Gem::Version
|
214
228
|
version: '0'
|
215
229
|
- !ruby/object:Gem::Dependency
|
216
|
-
name:
|
230
|
+
name: capybara
|
217
231
|
requirement: !ruby/object:Gem::Requirement
|
218
232
|
requirements:
|
219
233
|
- - ">="
|
@@ -227,7 +241,7 @@ dependencies:
|
|
227
241
|
- !ruby/object:Gem::Version
|
228
242
|
version: '0'
|
229
243
|
- !ruby/object:Gem::Dependency
|
230
|
-
name:
|
244
|
+
name: bundler
|
231
245
|
requirement: !ruby/object:Gem::Requirement
|
232
246
|
requirements:
|
233
247
|
- - ">="
|
@@ -241,7 +255,7 @@ dependencies:
|
|
241
255
|
- !ruby/object:Gem::Version
|
242
256
|
version: '0'
|
243
257
|
- !ruby/object:Gem::Dependency
|
244
|
-
name:
|
258
|
+
name: fog-aws
|
245
259
|
requirement: !ruby/object:Gem::Requirement
|
246
260
|
requirements:
|
247
261
|
- - ">="
|
@@ -255,19 +269,19 @@ dependencies:
|
|
255
269
|
- !ruby/object:Gem::Version
|
256
270
|
version: '0'
|
257
271
|
- !ruby/object:Gem::Dependency
|
258
|
-
name: fog
|
272
|
+
name: fog-local
|
259
273
|
requirement: !ruby/object:Gem::Requirement
|
260
274
|
requirements:
|
261
|
-
- - "
|
275
|
+
- - ">="
|
262
276
|
- !ruby/object:Gem::Version
|
263
|
-
version: '
|
277
|
+
version: '0'
|
264
278
|
type: :development
|
265
279
|
prerelease: false
|
266
280
|
version_requirements: !ruby/object:Gem::Requirement
|
267
281
|
requirements:
|
268
|
-
- - "
|
282
|
+
- - ">="
|
269
283
|
- !ruby/object:Gem::Version
|
270
|
-
version: '
|
284
|
+
version: '0'
|
271
285
|
- !ruby/object:Gem::Dependency
|
272
286
|
name: launchy
|
273
287
|
requirement: !ruby/object:Gem::Requirement
|
@@ -330,14 +344,14 @@ dependencies:
|
|
330
344
|
requirements:
|
331
345
|
- - ">="
|
332
346
|
- !ruby/object:Gem::Version
|
333
|
-
version:
|
347
|
+
version: 4.2.0
|
334
348
|
type: :development
|
335
349
|
prerelease: false
|
336
350
|
version_requirements: !ruby/object:Gem::Requirement
|
337
351
|
requirements:
|
338
352
|
- - ">="
|
339
353
|
- !ruby/object:Gem::Version
|
340
|
-
version:
|
354
|
+
version: 4.2.0
|
341
355
|
- !ruby/object:Gem::Dependency
|
342
356
|
name: generator_spec
|
343
357
|
requirement: !ruby/object:Gem::Requirement
|
@@ -386,7 +400,6 @@ files:
|
|
386
400
|
- RELEASING.md
|
387
401
|
- Rakefile
|
388
402
|
- UPGRADING
|
389
|
-
- cucumber/paperclip_steps.rb
|
390
403
|
- features/basic_integration.feature
|
391
404
|
- features/migration.feature
|
392
405
|
- features/rake_tasks.feature
|
@@ -404,9 +417,12 @@ files:
|
|
404
417
|
- features/support/paths.rb
|
405
418
|
- features/support/rails.rb
|
406
419
|
- features/support/selectors.rb
|
407
|
-
- gemfiles/
|
408
|
-
- gemfiles/4.1.gemfile
|
409
|
-
- gemfiles/4.2.gemfile
|
420
|
+
- gemfiles/4.2.awsv2.0.gemfile
|
421
|
+
- gemfiles/4.2.awsv2.1.gemfile
|
422
|
+
- gemfiles/4.2.awsv2.gemfile
|
423
|
+
- gemfiles/5.0.awsv2.0.gemfile
|
424
|
+
- gemfiles/5.0.awsv2.1.gemfile
|
425
|
+
- gemfiles/5.0.awsv2.gemfile
|
410
426
|
- lib/generators/paperclip/USAGE
|
411
427
|
- lib/generators/paperclip/paperclip_generator.rb
|
412
428
|
- lib/generators/paperclip/templates/paperclip_migration.rb.erb
|
@@ -438,14 +454,7 @@ files:
|
|
438
454
|
- lib/paperclip/io_adapters/stringio_adapter.rb
|
439
455
|
- lib/paperclip/io_adapters/uploaded_file_adapter.rb
|
440
456
|
- lib/paperclip/io_adapters/uri_adapter.rb
|
441
|
-
- lib/paperclip/locales/de.yml
|
442
457
|
- lib/paperclip/locales/en.yml
|
443
|
-
- lib/paperclip/locales/es.yml
|
444
|
-
- lib/paperclip/locales/ja.yml
|
445
|
-
- lib/paperclip/locales/pt-BR.yml
|
446
|
-
- lib/paperclip/locales/zh-CN.yml
|
447
|
-
- lib/paperclip/locales/zh-HK.yml
|
448
|
-
- lib/paperclip/locales/zh-TW.yml
|
449
458
|
- lib/paperclip/logger.rb
|
450
459
|
- lib/paperclip/matchers.rb
|
451
460
|
- lib/paperclip/matchers/have_attached_file_matcher.rb
|
@@ -490,6 +499,7 @@ files:
|
|
490
499
|
- spec/paperclip/geometry_detector_spec.rb
|
491
500
|
- spec/paperclip/geometry_parser_spec.rb
|
492
501
|
- spec/paperclip/geometry_spec.rb
|
502
|
+
- spec/paperclip/glue_spec.rb
|
493
503
|
- spec/paperclip/has_attached_file_spec.rb
|
494
504
|
- spec/paperclip/integration_spec.rb
|
495
505
|
- spec/paperclip/interpolations_spec.rb
|
@@ -561,14 +571,31 @@ files:
|
|
561
571
|
- spec/support/mock_interpolator.rb
|
562
572
|
- spec/support/mock_url_generator_builder.rb
|
563
573
|
- spec/support/model_reconstruction.rb
|
564
|
-
- spec/support/
|
574
|
+
- spec/support/reporting.rb
|
565
575
|
- spec/support/test_data.rb
|
566
576
|
- spec/support/version_helper.rb
|
567
577
|
homepage: https://github.com/thoughtbot/paperclip
|
568
578
|
licenses:
|
569
579
|
- MIT
|
570
580
|
metadata: {}
|
571
|
-
post_install_message:
|
581
|
+
post_install_message: |
|
582
|
+
##################################################
|
583
|
+
# NOTE FOR UPGRADING FROM 4.3.0 OR EARLIER #
|
584
|
+
##################################################
|
585
|
+
|
586
|
+
Paperclip is now compatible with aws-sdk >= 2.0.0.
|
587
|
+
|
588
|
+
If you are using S3 storage, aws-sdk >= 2.0.0 requires you to make a few small
|
589
|
+
changes:
|
590
|
+
|
591
|
+
* You must set the `s3_region`
|
592
|
+
* If you are explicitly setting permissions anywhere, such as in an initializer,
|
593
|
+
note that the format of the permissions changed from using an underscore to
|
594
|
+
using a hyphen. For example, `:public_read` needs to be changed to
|
595
|
+
`public-read`.
|
596
|
+
|
597
|
+
For a walkthrough of upgrading from 4 to 5 and aws-sdk >= 2.0 you can watch
|
598
|
+
http://rubythursday.com/episodes/ruby-snack-27-upgrade-paperclip-and-aws-sdk-in-prep-for-rails-5
|
572
599
|
rdoc_options: []
|
573
600
|
require_paths:
|
574
601
|
- lib
|
@@ -576,7 +603,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
576
603
|
requirements:
|
577
604
|
- - ">="
|
578
605
|
- !ruby/object:Gem::Version
|
579
|
-
version: 1.
|
606
|
+
version: 2.1.0
|
580
607
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
581
608
|
requirements:
|
582
609
|
- - ">="
|
@@ -585,7 +612,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
585
612
|
requirements:
|
586
613
|
- ImageMagick
|
587
614
|
rubyforge_project:
|
588
|
-
rubygems_version: 2.
|
615
|
+
rubygems_version: 2.6.2
|
589
616
|
signing_key:
|
590
617
|
specification_version: 4
|
591
618
|
summary: File attachments as attributes for ActiveRecord
|
@@ -618,6 +645,7 @@ test_files:
|
|
618
645
|
- spec/paperclip/geometry_detector_spec.rb
|
619
646
|
- spec/paperclip/geometry_parser_spec.rb
|
620
647
|
- spec/paperclip/geometry_spec.rb
|
648
|
+
- spec/paperclip/glue_spec.rb
|
621
649
|
- spec/paperclip/has_attached_file_spec.rb
|
622
650
|
- spec/paperclip/integration_spec.rb
|
623
651
|
- spec/paperclip/interpolations_spec.rb
|
@@ -689,7 +717,6 @@ test_files:
|
|
689
717
|
- spec/support/mock_interpolator.rb
|
690
718
|
- spec/support/mock_url_generator_builder.rb
|
691
719
|
- spec/support/model_reconstruction.rb
|
692
|
-
- spec/support/
|
720
|
+
- spec/support/reporting.rb
|
693
721
|
- spec/support/test_data.rb
|
694
722
|
- spec/support/version_helper.rb
|
695
|
-
has_rdoc:
|
data/cucumber/paperclip_steps.rb
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
When /^I attach an? "([^\"]*)" "([^\"]*)" file to an? "([^\"]*)" on S3$/ do |attachment, extension, model|
|
2
|
-
stub_paperclip_s3(model, attachment, extension)
|
3
|
-
attach_file attachment,
|
4
|
-
"features/support/paperclip/#{model.gsub(" ", "_").underscore}/#{attachment}.#{extension}"
|
5
|
-
end
|
6
|
-
|
data/gemfiles/3.2.gemfile
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "sqlite3", "~> 1.3.8", :platforms => :ruby
|
6
|
-
gem "jruby-openssl", :platforms => :jruby
|
7
|
-
gem "activerecord-jdbcsqlite3-adapter", :platforms => :jruby
|
8
|
-
gem "rubysl", :platforms => :rbx
|
9
|
-
gem "racc", :platforms => :rbx
|
10
|
-
gem "pry"
|
11
|
-
gem "rails", "~> 3.2.15"
|
12
|
-
gem "paperclip", :path => "../"
|
13
|
-
|
14
|
-
group :development, :test do
|
15
|
-
gem "mime-types", "~> 1.16"
|
16
|
-
gem "builder"
|
17
|
-
gem "rubocop", :require => false
|
18
|
-
end
|
19
|
-
|
20
|
-
gemspec :path => "../"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
de:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "muss zwischen %{min} und %{max} sein"
|
5
|
-
spoofed_media_type: "trägt eine Dateiendung, die nicht mit dem Inhalt der Datei übereinstimmt"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
es:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "debe estar entre %{min} y %{max}"
|
5
|
-
spoofed_media_type: "tiene una extensión que no coincide con su contenido"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
ja:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "の容量は%{min}以上%{max}以下にしてください。"
|
5
|
-
spoofed_media_type: "の拡張子と内容が一致していません。"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
pt-BR:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "deve ter entre %{min} e %{max}"
|
5
|
-
spoofed_media_type: "tem uma extensão que não corresponde ao seu conteúdo"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
zh-CN:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "文件大小必须介于 %{min} 到 %{max} 之间"
|
5
|
-
spoofed_media_type: "扩展名与内容类型不符"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
zh-HK:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "必須介於%{min}到%{max}之間"
|
5
|
-
spoofed_media_type: "副檔名與內容類型不匹配"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
zh-TW:
|
2
|
-
errors:
|
3
|
-
messages:
|
4
|
-
in_between: "檔案大小必須介於 %{min} 到 %{max} 之間"
|
5
|
-
spoofed_media_type: "副檔名與內容類型不符"
|
6
|
-
|
7
|
-
number:
|
8
|
-
human:
|
9
|
-
storage_units:
|
10
|
-
format: "%n %u"
|
11
|
-
units:
|
12
|
-
byte:
|
13
|
-
one: "Byte"
|
14
|
-
other: "Bytes"
|
15
|
-
kb: "KB"
|
16
|
-
mb: "MB"
|
17
|
-
gb: "GB"
|
18
|
-
tb: "TB"
|