carrierwave 0.10.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of carrierwave might be problematic. Click here for more details.

Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +248 -116
  3. data/lib/carrierwave/compatibility/paperclip.rb +0 -2
  4. data/lib/carrierwave/error.rb +1 -0
  5. data/lib/carrierwave/locale/en.yml +7 -4
  6. data/lib/carrierwave/mount.rb +219 -176
  7. data/lib/carrierwave/mounter.rb +165 -0
  8. data/lib/carrierwave/orm/activerecord.rb +50 -21
  9. data/lib/carrierwave/processing/mini_magick.rb +82 -15
  10. data/lib/carrierwave/processing/rmagick.rb +47 -4
  11. data/lib/carrierwave/processing.rb +0 -1
  12. data/lib/carrierwave/sanitized_file.rb +38 -18
  13. data/lib/carrierwave/storage/abstract.rb +15 -2
  14. data/lib/carrierwave/storage/file.rb +65 -2
  15. data/lib/carrierwave/storage/fog.rb +106 -31
  16. data/lib/carrierwave/storage.rb +0 -7
  17. data/lib/carrierwave/test/matchers.rb +77 -12
  18. data/lib/carrierwave/uploader/cache.rb +58 -30
  19. data/lib/carrierwave/uploader/callbacks.rb +0 -2
  20. data/lib/carrierwave/uploader/configuration.rb +51 -8
  21. data/lib/carrierwave/uploader/content_type_blacklist.rb +48 -0
  22. data/lib/carrierwave/uploader/content_type_whitelist.rb +48 -0
  23. data/lib/carrierwave/uploader/default_url.rb +3 -5
  24. data/lib/carrierwave/uploader/download.rb +15 -8
  25. data/lib/carrierwave/uploader/extension_blacklist.rb +14 -10
  26. data/lib/carrierwave/uploader/extension_whitelist.rb +13 -10
  27. data/lib/carrierwave/uploader/file_size.rb +43 -0
  28. data/lib/carrierwave/uploader/magic_mime_blacklist.rb +94 -0
  29. data/lib/carrierwave/uploader/magic_mime_whitelist.rb +94 -0
  30. data/lib/carrierwave/uploader/mountable.rb +7 -8
  31. data/lib/carrierwave/uploader/processing.rb +10 -10
  32. data/lib/carrierwave/uploader/proxy.rb +5 -7
  33. data/lib/carrierwave/uploader/remove.rb +0 -2
  34. data/lib/carrierwave/uploader/serialization.rb +1 -3
  35. data/lib/carrierwave/uploader/store.rb +5 -23
  36. data/lib/carrierwave/uploader/url.rb +3 -5
  37. data/lib/carrierwave/uploader/versions.rb +75 -82
  38. data/lib/carrierwave/uploader.rb +6 -2
  39. data/lib/carrierwave/utilities/uri.rb +5 -6
  40. data/lib/carrierwave/utilities.rb +0 -3
  41. data/lib/carrierwave/validations/active_model.rb +3 -5
  42. data/lib/carrierwave/version.rb +1 -1
  43. data/lib/carrierwave.rb +12 -10
  44. data/lib/generators/templates/uploader.rb +4 -6
  45. metadata +37 -61
  46. data/lib/carrierwave/locale/cs.yml +0 -11
  47. data/lib/carrierwave/locale/de.yml +0 -11
  48. data/lib/carrierwave/locale/el.yml +0 -11
  49. data/lib/carrierwave/locale/es.yml +0 -11
  50. data/lib/carrierwave/locale/fr.yml +0 -11
  51. data/lib/carrierwave/locale/ja.yml +0 -11
  52. data/lib/carrierwave/locale/nb.yml +0 -11
  53. data/lib/carrierwave/locale/nl.yml +0 -11
  54. data/lib/carrierwave/locale/pl.yml +0 -11
  55. data/lib/carrierwave/locale/pt-BR.yml +0 -11
  56. data/lib/carrierwave/locale/pt-PT.yml +0 -11
  57. data/lib/carrierwave/locale/ru.yml +0 -11
  58. data/lib/carrierwave/locale/sk.yml +0 -11
  59. data/lib/carrierwave/locale/tr.yml +0 -11
  60. data/lib/carrierwave/processing/mime_types.rb +0 -74
  61. data/lib/carrierwave/utilities/deprecation.rb +0 -18
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-26 00:00:00.000000000 Z
11
+ date: 2017-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,42 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.2.0
19
+ version: 4.0.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: 3.2.0
26
+ version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activemodel
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 3.2.0
33
+ version: 4.0.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: 3.2.0
41
- - !ruby/object:Gem::Dependency
42
- name: json
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '1.7'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '1.7'
40
+ version: 4.0.0
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: mime-types
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +53,7 @@ dependencies:
67
53
  - !ruby/object:Gem::Version
68
54
  version: '1.16'
69
55
  - !ruby/object:Gem::Dependency
70
- name: mysql2
56
+ name: pg
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - ">="
@@ -86,44 +72,44 @@ dependencies:
86
72
  requirements:
87
73
  - - ">="
88
74
  - !ruby/object:Gem::Version
89
- version: 3.2.0
75
+ version: 4.0.0
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - ">="
95
81
  - !ruby/object:Gem::Version
96
- version: 3.2.0
82
+ version: 4.0.0
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: cucumber
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
87
  - - "~>"
102
88
  - !ruby/object:Gem::Version
103
- version: 1.3.2
89
+ version: '2.3'
104
90
  type: :development
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
94
  - - "~>"
109
95
  - !ruby/object:Gem::Version
110
- version: 1.3.2
96
+ version: '2.3'
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: rspec
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
101
  - - "~>"
116
102
  - !ruby/object:Gem::Version
117
- version: 2.13.0
103
+ version: '3.4'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
108
  - - "~>"
123
109
  - !ruby/object:Gem::Version
124
- version: 2.13.0
110
+ version: '3.4'
125
111
  - !ruby/object:Gem::Dependency
126
- name: sham_rack
112
+ name: webmock
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
115
  - - ">="
@@ -142,14 +128,14 @@ dependencies:
142
128
  requirements:
143
129
  - - ">="
144
130
  - !ruby/object:Gem::Version
145
- version: 1.3.1
131
+ version: 1.28.0
146
132
  type: :development
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
136
  - - ">="
151
137
  - !ruby/object:Gem::Version
152
- version: 1.3.1
138
+ version: 1.28.0
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: mini_magick
155
141
  requirement: !ruby/object:Gem::Requirement
@@ -179,35 +165,35 @@ dependencies:
179
165
  - !ruby/object:Gem::Version
180
166
  version: '0'
181
167
  - !ruby/object:Gem::Dependency
182
- name: nokogiri
168
+ name: timecop
183
169
  requirement: !ruby/object:Gem::Requirement
184
170
  requirements:
185
- - - "~>"
171
+ - - ">="
186
172
  - !ruby/object:Gem::Version
187
- version: 1.5.10
173
+ version: '0'
188
174
  type: :development
189
175
  prerelease: false
190
176
  version_requirements: !ruby/object:Gem::Requirement
191
177
  requirements:
192
- - - "~>"
178
+ - - ">="
193
179
  - !ruby/object:Gem::Version
194
- version: 1.5.10
180
+ version: '0'
195
181
  - !ruby/object:Gem::Dependency
196
- name: timecop
182
+ name: generator_spec
197
183
  requirement: !ruby/object:Gem::Requirement
198
184
  requirements:
199
- - - '='
185
+ - - ">="
200
186
  - !ruby/object:Gem::Version
201
- version: 0.6.1
187
+ version: 0.9.1
202
188
  type: :development
203
189
  prerelease: false
204
190
  version_requirements: !ruby/object:Gem::Requirement
205
191
  requirements:
206
- - - '='
192
+ - - ">="
207
193
  - !ruby/object:Gem::Version
208
- version: 0.6.1
194
+ version: 0.9.1
209
195
  - !ruby/object:Gem::Dependency
210
- name: generator_spec
196
+ name: pry
211
197
  requirement: !ruby/object:Gem::Requirement
212
198
  requirements:
213
199
  - - ">="
@@ -233,25 +219,11 @@ files:
233
219
  - lib/carrierwave.rb
234
220
  - lib/carrierwave/compatibility/paperclip.rb
235
221
  - lib/carrierwave/error.rb
236
- - lib/carrierwave/locale/cs.yml
237
- - lib/carrierwave/locale/de.yml
238
- - lib/carrierwave/locale/el.yml
239
222
  - lib/carrierwave/locale/en.yml
240
- - lib/carrierwave/locale/es.yml
241
- - lib/carrierwave/locale/fr.yml
242
- - lib/carrierwave/locale/ja.yml
243
- - lib/carrierwave/locale/nb.yml
244
- - lib/carrierwave/locale/nl.yml
245
- - lib/carrierwave/locale/pl.yml
246
- - lib/carrierwave/locale/pt-BR.yml
247
- - lib/carrierwave/locale/pt-PT.yml
248
- - lib/carrierwave/locale/ru.yml
249
- - lib/carrierwave/locale/sk.yml
250
- - lib/carrierwave/locale/tr.yml
251
223
  - lib/carrierwave/mount.rb
224
+ - lib/carrierwave/mounter.rb
252
225
  - lib/carrierwave/orm/activerecord.rb
253
226
  - lib/carrierwave/processing.rb
254
- - lib/carrierwave/processing/mime_types.rb
255
227
  - lib/carrierwave/processing/mini_magick.rb
256
228
  - lib/carrierwave/processing/rmagick.rb
257
229
  - lib/carrierwave/sanitized_file.rb
@@ -264,10 +236,15 @@ files:
264
236
  - lib/carrierwave/uploader/cache.rb
265
237
  - lib/carrierwave/uploader/callbacks.rb
266
238
  - lib/carrierwave/uploader/configuration.rb
239
+ - lib/carrierwave/uploader/content_type_blacklist.rb
240
+ - lib/carrierwave/uploader/content_type_whitelist.rb
267
241
  - lib/carrierwave/uploader/default_url.rb
268
242
  - lib/carrierwave/uploader/download.rb
269
243
  - lib/carrierwave/uploader/extension_blacklist.rb
270
244
  - lib/carrierwave/uploader/extension_whitelist.rb
245
+ - lib/carrierwave/uploader/file_size.rb
246
+ - lib/carrierwave/uploader/magic_mime_blacklist.rb
247
+ - lib/carrierwave/uploader/magic_mime_whitelist.rb
271
248
  - lib/carrierwave/uploader/mountable.rb
272
249
  - lib/carrierwave/uploader/processing.rb
273
250
  - lib/carrierwave/uploader/proxy.rb
@@ -277,7 +254,6 @@ files:
277
254
  - lib/carrierwave/uploader/url.rb
278
255
  - lib/carrierwave/uploader/versions.rb
279
256
  - lib/carrierwave/utilities.rb
280
- - lib/carrierwave/utilities/deprecation.rb
281
257
  - lib/carrierwave/utilities/uri.rb
282
258
  - lib/carrierwave/validations/active_model.rb
283
259
  - lib/carrierwave/version.rb
@@ -296,16 +272,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
296
272
  requirements:
297
273
  - - ">="
298
274
  - !ruby/object:Gem::Version
299
- version: '0'
275
+ version: 2.0.0
300
276
  required_rubygems_version: !ruby/object:Gem::Requirement
301
277
  requirements:
302
278
  - - ">="
303
279
  - !ruby/object:Gem::Version
304
280
  version: '0'
305
281
  requirements: []
306
- rubyforge_project: carrierwave
307
- rubygems_version: 2.2.0
282
+ rubyforge_project:
283
+ rubygems_version: 2.5.2
308
284
  signing_key:
309
- specification_version: 3
285
+ specification_version: 4
310
286
  summary: Ruby file upload library
311
287
  test_files: []
@@ -1,11 +0,0 @@
1
- cs:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: se nepodařilo zpracovat
5
- carrierwave_integrity_error: není povolený typ souboru
6
- carrierwave_download_error: nemůže být stažen
7
- extension_white_list_error: "Není možné nahrávat %{extension} soubory, povolené typy: %{allowed_types}"
8
- extension_black_list_error: "Není možné nahrávat %{extension} soubory, zakázané typy: %{prohibited_types}"
9
- rmagick_processing_error: "Nepodařilo se upravit pomocí rmagick, možná se nejedná o obrázek? Hlášená Chyba: %{e}"
10
- mime_types_processing_error: "Nepodařilo se upravit s MIME::Types, možná se nejedná o content-type? Hlášená Chyba: %{e}"
11
- mini_magick_processing_error: "Nepodařilo se upravit pomocí MiniMagick, možná se nejedná o obrázek? Hlášená Chyba: %{e}"
@@ -1,11 +0,0 @@
1
- de:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: konnte nicht verarbeitet werden
5
- carrierwave_integrity_error: ist kein erlaubter Dateityp
6
- carrierwave_download_error: konnte nicht heruntergeladen werden
7
- extension_white_list_error: "Sie sind nicht berechtigt %{extension} Dateien hochzuladen, erlaubte Typen: %{allowed_types}"
8
- extension_black_list_error: "Sie sind nicht berechtigt %{extension} Dateien hochzuladen, verbotene Typen: %{prohibited_types}"
9
- rmagick_processing_error: "Verarbeitung mit rmagick fehlgeschlagen, vielleicht ist es kein Bild? Original Fehler: %{e}"
10
- mime_types_processing_error: "Verarbeitung mit MIME::Types fehlgeschlagen, vielleicht kein gültiger content-type? Original Fehler: %{e}"
11
- mini_magick_processing_error: "Verarbeitung mit MiniMagick fehlgeschlagen, vielleicht ist es kein Bild? Original Fehler: %{e}"
@@ -1,11 +0,0 @@
1
- el:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: "απέτυχε στην επεξεργασία"
5
- carrierwave_integrity_error: "δεν ανήκει σε επιτρεπτό τύπο αρχείου"
6
- carrierwave_download_error: "δεν ήταν δυνατό να μεταφορτωθεί"
7
- extension_white_list_error: "Δεν επιτρέπεται το ανέβασμα αρχείων %{extension}, επιτρεπτοί τύποι: %{allowed_types}"
8
- extension_black_list_error: "Δεν επιτρέπεται το ανέβασμα αρχείων %{extension}, μη επιτρεπτοί τύποι: %{prohibited_types}"
9
- rmagick_processing_error: "Απέτυχε ο χειρισμός με rmagick, ίσως δεν είναι εικόνα; Αρχικό Σφάλμα: %{e}"
10
- mime_types_processing_error: "Απέτυχε η επεξεργασία του αρχείου με MIME::Types, ίσως δεν έχει έγκυρο content-type; Αρχικό Σφάλμα: %{e}"
11
- mini_magick_processing_error: "Απέτυχε ο χειρισμός με MiniMagick, ίσως δεν είναι εικόνα; Αρχικό Σφάλμα: %{e}"
@@ -1,11 +0,0 @@
1
- es:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: no se pudo procesar
5
- carrierwave_integrity_error: no es de un tipo de archivo permitido
6
- carrierwave_download_error: no se pudo descargar
7
- extension_white_list_error: "No se pueden subir archivos de esta extensión %{extension}, las extensiones permitidas son: %{allowed_types}"
8
- extension_black_list_error: "No se pueden subir archivos de esta extensión %{extension}, las extensiones prohibidas son: %{allowed_types}"
9
- rmagick_processing_error: "No se pudo manipular con rmagick, quizá porque no es una imágen? Error original: %{e}"
10
- mime_types_processing_error: "No se pudo procesar archivo con MIME::Types, quizá no tiene el content-type correcto? Error original: %{e}"
11
- mini_magick_processing_error: "No se pudo manipular con MiniMagick, quizá porque no es una imágen? Error original: %{e}"
@@ -1,11 +0,0 @@
1
- fr:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: "Impossible de redimensionner l'image."
5
- carrierwave_integrity_error: "Ce n'est pas une image."
6
- carrierwave_download_error: "Impossible de télécharger l'image."
7
- extension_white_list_error: "Vous n'êtes pas autorisé à uploader des fichiers %{extension}, types autorisés: %{allowed_types}"
8
- extension_black_list_error: "Vous n'êtes pas autorisé à uploader des fichiers %{extension}, types interdits: %{prohibited_types}"
9
- rmagick_processing_error: "La manipulation d'image avec rmagick a échoué. Peut-être que ce n'est pas une image ? Erreur originale: %{e}"
10
- mime_types_processing_error: "Le traitement de fichier avec MIME::Types a échoué. Peut-être que ce n'est pas un type valide ? Erreur originale: %{e}"
11
- mini_magick_processing_error: "La manipulation d'image avec MiniMagick a échoué. Peut-être que ce n'est pas une image ? Erreur originale: %{e}"
@@ -1,11 +0,0 @@
1
- ja:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: 処理できませんでした
5
- carrierwave_integrity_error: は許可されていないファイルタイプです
6
- carrierwave_download_error: はダウンロードできません
7
- extension_white_list_error: "%{extension}ファイルのアップロードは許可されていません。アップロードできるファイルタイプ: %{allowed_types}"
8
- extension_black_list_error: "%{extension}ファイルのアップロードは許可されていません。アップロードできないファイルタイプ: %{prohibited_types}"
9
- rmagick_processing_error: "rmagickがファイルを処理できませんでした。画像を確認してください。エラーメッセージ: %{e}"
10
- mime_types_processing_error: "MIME::Typesのファイルを処理できませんでした。Content-Typeを確認してください。エラーメッセージ: %{e}"
11
- mini_magick_processing_error: "MiniMagickがファイルを処理できませんでした。画像を確認してください。エラーメッセージ: %{e}"
@@ -1,11 +0,0 @@
1
- nb:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: kunne ikke behandles
5
- carrierwave_integrity_error: er ikke en tillatt filtype
6
- carrierwave_download_error: kunne ikke lastes ned
7
- extension_white_list_error: "Du kan ikke laste opp %{extension}-filer, tillatte filtyper: %{allowed_types}"
8
- extension_black_list_error: "Du kan ikke laste opp %{extension}-filer, forbudte filtyper: %{prohibited_types}"
9
- rmagick_processing_error: "Kunne ikke manipulere med rmagick. Er du sikker på at det er et bilde? Feilmelding: %{e}"
10
- mime_types_processing_error: "Kunne ikke behandle fil med MIME::Types. Er du sikker på at content-type er korrekt? Feilmelding: %{e}"
11
- mini_magick_processing_error: "Kunne ikke manipulere med MiniMagick. Er du sikker på at det er et bilde? Feilmelding: %{e}"
@@ -1,11 +0,0 @@
1
- nl:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: kon niet worden verwerkt
5
- carrierwave_integrity_error: is niet van een toegestaan bestandstype
6
- carrierwave_download_error: kon niet gedownload worden
7
- extension_white_list_error: "Het is niet toegestaan om %{extension} bestanden te uploaden; toegestane bestandstypes: %{allowed_types}"
8
- extension_black_list_error: "Het is niet toegestaan om %{extension} bestanden te uploaden; verboden bestandstypes: %{prohibited_types}"
9
- rmagick_processing_error: "Bewerking met rmagick is mislukt, misschien is het geen afbeelding? Originele foutmelding: %{e}"
10
- mime_types_processing_error: "Verwerking van bestand met MIME::Types is mislukt, misschien is het geen geldig content-type? Originele foutmelding: %{e}"
11
- mini_magick_processing_error: "Bewerking met MiniMagick is mislukt, misschien is het geen afbeelding? Originele foutmelding: %{e}"
@@ -1,11 +0,0 @@
1
- pl:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: nie można przetworzyć
5
- carrierwave_integrity_error: niedozwolony typ pliku
6
- carrierwave_download_error: nie można pobrać pliku
7
- extension_white_list_error: "Nie można wgrać pliku o rozszerzeniu %{extension}, dozwolone typy plików: %{allowed_types}"
8
- extension_black_list_error: "Nie można wgrać pliku o rozszerzeniu %{extension}, zakazane typy plików: %{prohibited_types}"
9
- rmagick_processing_error: "Nie udało się przetworzyć pliku przy pomocy rmagick, może to nie jest obrazek? Oryginalna treść błędu: %{e}"
10
- mime_types_processing_error: "Nie udało się przetworzyć pliku przy pomocy MIME::Types, może content-type jest niepoprawny? Oryginalna treść błędu: %{e}"
11
- mini_magick_processing_error: "Nie udało się przetworzyć pliku przy pomocy MiniMagick, może to nie jest obrazek? Oryginalna treść błędu: %{e}"
@@ -1,11 +0,0 @@
1
- pt-BR:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: falhou em ser processado
5
- carrierwave_integrity_error: não é um tipo de arquivo permitido
6
- carrierwave_download_error: não pôde ser baixado
7
- extension_white_list_error: "Não é permitido o envio de arquivos %{extension}, tipos permitidos: %{allowed_types}"
8
- extension_black_list_error: "Não é permitido o envio de arquivos %{extension}, tipos proibidos: %{prohibited_types}"
9
- rmagick_processing_error: "Falha ao manipular com RMagick, talvez arquivo não seja uma imagem? Erro original: %{e}"
10
- mime_types_processing_error: "Falha ao processar arquivo com MIME::Types, talvez content-type seja inválido? Erro original: %{e}"
11
- mini_magick_processing_error: "Falha ao manipular com MiniMagick, talvez arquivo não seja uma imagem? Erro original: %{e}"
@@ -1,11 +0,0 @@
1
- pt-PT:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: falhou ao ser processado
5
- carrierwave_integrity_error: não é um tipo de ficheiro permitido
6
- carrierwave_download_error: não pôde ser transferido
7
- extension_white_list_error: "Não é permitido o envio de ficheiros com a extensão %{extension}, tipos de ficheiro permitidos: %{allowed_types}"
8
- extension_black_list_error: "Não é permitido o envio de ficheiros com a extensão %{extension}, tipos de ficheiro proibidos: %{prohibited_types}"
9
- rmagick_processing_error: "Ocorreu uma falha ao processar com rmagick, talvez o ficheiro não seja uma imagem? Erro original: %{e}"
10
- mime_types_processing_error: "Ocorreu uma falha ao processar com MIME::Types, talvez o parâmetro content-type não seja válido? Erro original: %{e}"
11
- mini_magick_processing_error: "Ocorreu uma falha ao processar com MiniMagick, talvez o ficheiro não seja uma imagem? Erro original: %{e}"
@@ -1,11 +0,0 @@
1
- ru:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: Невозможно обработать изображение
5
- carrierwave_integrity_error: Файл не является изображением
6
- carrierwave_download_error: Невозможно скачать файл
7
- extension_white_list_error: "Вы не можете загружать файлы типа %{extension}, разрешенные типы: %{allowed_types}"
8
- extension_black_list_error: "Вы не можете загружать файлы типа %{extension}, запрещенные типы: %{prohibited_types}"
9
- rmagick_processing_error: "Ошибка взаимодействия с RMagick, может быть это не изображение? Исходная ошибка: %{e}"
10
- mime_types_processing_error: "Не получилось обработать файл с MIME::Types, возможно неправильный content-type? Исходная ошибка: %{e}"
11
- mini_magick_processing_error: "Ошибка взаимодействия с MiniMagick, может быть это не изображение? Исходная ошибка: %{e}"
@@ -1,11 +0,0 @@
1
- sk:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: sa nepodarilo spracovať
5
- carrierwave_integrity_error: nie je povolený typ súboru
6
- carrierwave_download_error: nie je možné stiahnuť
7
- extension_white_list_error: "Nie je možné nahrávať %{extension} súbory, povolené typy: %{allowed_types}"
8
- extension_black_list_error: "Nie je možné nahrávať %{extension} súbory, zakázané typy: %{prohibited_types}"
9
- rmagick_processing_error: "Nepodarilo sa upraviť pomocou rmagick, možno nejde o obrázok? Hlásená chyba: %{e}"
10
- mime_types_processing_error: "Súbor sa nepodarilo spracovať pomocou MIME::Types, možno nejde o valídny content-type? Hlásená chyba: %{e}"
11
- mini_magick_processing_error: "Nepodarilo sa upraviť pomocou MiniMagick, možno nejde o obrázok? Hlásená chyba: %{e}"
@@ -1,11 +0,0 @@
1
- tr:
2
- errors:
3
- messages:
4
- carrierwave_processing_error: işlenmesi sırasında hata oluştu
5
- carrierwave_integrity_error: izin verilebilir bir dosya türü değil
6
- carrierwave_download_error: indirilemedi
7
- extension_white_list_error: "%{extension} uzantılı dosyaları yükleme izniniz yok, izin verilen uzantılar: %{allowed_types}"
8
- extension_black_list_error: "%{extension} uzantılı dosyaları yükleme izniniz yok, izin verilmeyen uzantılar: %{prohibited_types}"
9
- rmagick_processing_error: "Resim rmagick ile düzenlenemedi, belkide resim değildir? Orjinal Hata: %{e}"
10
- mime_types_processing_error: "Dosya, MIME::Types kullanılarak işlenemedi, belkide geçerli bir içerik türü değildir? Orjinal Hata: %{e}"
11
- mini_magick_processing_error: "Resim MiniMagick ile düzenlenemedi, belkide resim değildir? Orjinal Hata: %{e}"
@@ -1,74 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module CarrierWave
4
-
5
- ##
6
- # This module simplifies the use of the mime-types gem to intelligently
7
- # guess and set the content-type of a file. If you want to use this, you'll
8
- # need to require this file:
9
- #
10
- # require 'carrierwave/processing/mime_types'
11
- #
12
- # And then include it in your uploader:
13
- #
14
- # class MyUploader < CarrierWave::Uploader::Base
15
- # include CarrierWave::MimeTypes
16
- # end
17
- #
18
- # You can now use the provided helper:
19
- #
20
- # class MyUploader < CarrierWave::Uploader::Base
21
- # include CarrierWave::MimeTypes
22
- #
23
- # process :set_content_type
24
- # end
25
- #
26
- module MimeTypes
27
- extend ActiveSupport::Concern
28
-
29
- included do
30
- CarrierWave::Utilities::Deprecation.new "0.11.0", "CarrierWave::MimeTypes is deprecated and will be removed in the future, get the content_type from the SanitizedFile object directly."
31
- begin
32
- require "mime/types"
33
- rescue LoadError => e
34
- e.message << " (You may need to install the mime-types gem)"
35
- raise e
36
- end
37
- end
38
-
39
- module ClassMethods
40
- def set_content_type(override=false)
41
- process :set_content_type => override
42
- end
43
- end
44
-
45
- GENERIC_CONTENT_TYPES = %w[application/octet-stream binary/octet-stream]
46
-
47
- def generic_content_type?
48
- GENERIC_CONTENT_TYPES.include? file.content_type
49
- end
50
-
51
- ##
52
- # Changes the file content_type using the mime-types gem
53
- #
54
- # === Parameters
55
- #
56
- # [override (Boolean)] whether or not to override the file's content_type
57
- # if it is already set and not a generic content-type,
58
- # false by default
59
- #
60
- def set_content_type(override=false)
61
- if override || file.content_type.blank? || generic_content_type?
62
- new_content_type = ::MIME::Types.type_for(file.original_filename).first.to_s
63
- if file.respond_to?(:content_type=)
64
- file.content_type = new_content_type
65
- else
66
- file.instance_variable_set(:@content_type, new_content_type)
67
- end
68
- end
69
- rescue ::MIME::InvalidContentType => e
70
- raise CarrierWave::ProcessingError, I18n.translate(:"errors.messages.mime_types_processing_error", :e => e)
71
- end
72
-
73
- end # MimeTypes
74
- end # CarrierWave
@@ -1,18 +0,0 @@
1
- # encoding: utf-8
2
- require 'active_support/deprecation'
3
-
4
- module CarrierWave
5
- module Utilities
6
- module Deprecation
7
-
8
- def self.new version = '0.11.0', message = 'Carrierwave'
9
- if ActiveSupport::VERSION::MAJOR < 4
10
- ActiveSupport::Deprecation.warn("#{message} (will be removed from version #{version})")
11
- else
12
- ActiveSupport::Deprecation.new(version, message)
13
- end
14
- end
15
-
16
- end # Deprecation
17
- end # Utilities
18
- end # CarrierWave