Skip to content

Commit

Permalink
Remove CarrierWave::MimeTypes processor module
Browse files Browse the repository at this point in the history
Since carrierwaveuploader#1245 (*), CarrierWave::MimeTypes module is redundant as
`mime-types` gem is a runtime dependency now, and `SanitizedFile` gets
it's content_type using it.
The module was deprecated since 0.10 and warned developers when used it.

(*) I discovered this when tried to fix specs marked as pending. I
looked at commits history and PRs to understand what happened.
It started with carrierwaveuploader#372 that added `CarrierWave::MimeTypes`  processor (Jun
2011), then carrierwaveuploader#1216 and carrierwaveuploader#1245 that made `mime-types` a runtime dependency
and deprecated `CarrierWave::MimeTypes` module (2013), and finally carrierwaveuploader#1584
`CarrierWave::MagicMimeTypes` (2015)
  • Loading branch information
Mehdi Lahmam committed Jan 1, 2016
1 parent 7f05a98 commit 2fc9ed3
Show file tree
Hide file tree
Showing 22 changed files with 1 addition and 171 deletions.
1 change: 0 additions & 1 deletion lib/carrierwave/locale/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ cs:
extension_white_list_error: "Není možné nahrávat %{extension} soubory, povolené typy: %{allowed_types}"
extension_black_list_error: "Není možné nahrávat %{extension} soubory, zakázané typy: %{prohibited_types}"
rmagick_processing_error: "Nepodařilo se upravit pomocí rmagick, možná se nejedná o obrázek? Hlášená Chyba: %{e}"
mime_types_processing_error: "Nepodařilo se upravit s MIME::Types, možná se nejedná o content-type? Hlášená Chyba: %{e}"
mini_magick_processing_error: "Nepodařilo se upravit pomocí MiniMagick, možná se nejedná o obrázek? Hlášená Chyba: %{e}"
min_size_error: "Velikost souboru by měla být větší než %{min_size}"
max_size_error: "Velikost souboru by měla být nižší než %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ de:
extension_white_list_error: "Sie sind nicht berechtigt %{extension} Dateien hochzuladen, erlaubte Typen: %{allowed_types}"
extension_black_list_error: "Sie sind nicht berechtigt %{extension} Dateien hochzuladen, verbotene Typen: %{prohibited_types}"
rmagick_processing_error: "Verarbeitung mit rmagick fehlgeschlagen, vielleicht ist es kein Bild? Original Fehler: %{e}"
mime_types_processing_error: "Verarbeitung mit MIME::Types fehlgeschlagen, vielleicht kein gültiger content-type? Original Fehler: %{e}"
mini_magick_processing_error: "Verarbeitung mit MiniMagick fehlgeschlagen, vielleicht ist es kein Bild? Original Fehler: %{e}"
min_size_error: "Die dateigröße sollte größer sein als %{min_size}"
max_size_error: "Die dateigröße sollte weniger als sein %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ el:
mime_type_pattern_white_list_error: "Δεν επιτρέπεται το ανέβασμα αρχείων τύπου %{content_type}"
mime_type_pattern_black_list_error: "Δεν επιτρέπεται το ανέβασμα αρχείων τύπου %{content_type}"
rmagick_processing_error: "Απέτυχε ο χειρισμός με rmagick, ίσως δεν είναι εικόνα; Αρχικό Σφάλμα: %{e}"
mime_types_processing_error: "Απέτυχε η επεξεργασία του αρχείου με MIME::Types, ίσως δεν έχει έγκυρο content-type; Αρχικό Σφάλμα: %{e}"
mini_magick_processing_error: "Απέτυχε ο χειρισμός με MiniMagick, ίσως δεν είναι εικόνα; Αρχικό Σφάλμα: %{e}"
min_size_error: "το μέγεθος του αρχείου θα πρέπει να είναι μεγαλύτερο από %{min_size}"
max_size_error: "το μέγεθος του αρχείου θα πρέπει να είναι μικρότερο από %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ en:
mime_type_pattern_white_list_error: "You are not allowed to upload %{content_type} files"
mime_type_pattern_black_list_error: "You are not allowed to upload %{content_type} files"
rmagick_processing_error: "Failed to manipulate with rmagick, maybe it is not an image?"
mime_types_processing_error: "Failed to process file with MIME::Types, maybe not valid content-type? Original Error: %{e}"
mini_magick_processing_error: "Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: %{e}"
min_size_error: "File size should be greater than %{min_size}"
max_size_error: "File size should be less than %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ es:
extension_white_list_error: "No se pueden subir archivos de la extensión %{extension}. Las extensiones permitidas son: %{allowed_types}"
extension_black_list_error: "No se pueden subir archivos de la extensión %{extension}. Las extensiones prohibidas son: %{prohibited_types}"
rmagick_processing_error: "No se pudo manipular con rmagick, quizá porque no es una imágen? Error original: %{e}"
mime_types_processing_error: "No se pudo procesar archivo con MIME::Types, quizá no tiene el content-type correcto? Error original: %{e}"
mini_magick_processing_error: "No se pudo manipular con MiniMagick, quizá porque no es una imágen? Error original: %{e}"
min_size_error: "El tamaño del archivo debe ser mayor que %{min_size}"
max_size_error: "El tamaño del archivo debe ser inferior a %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/fr-CA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ fr_CA:
extension_white_list_error: "Vous n'êtes pas autorisé à uploader des fichiers %{extension}, types autorisés: %{allowed_types}"
extension_black_list_error: "Vous n'êtes pas autorisé à uploader des fichiers %{extension}, types interdits: %{prohibited_types}"
rmagick_processing_error: "La manipulation d'image avec rmagick a échoué. Peut-être que ce n'est pas une image? Erreur originale: %{e}"
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}"
mini_magick_processing_error: "La manipulation d'image avec MiniMagick a échoué. Peut-être que ce n'est pas une image? Erreur originale: %{e}"
min_size_error: "La taille du fichier doit être supérieure à %{min_size}"
max_size_error: "La taille du fichier doit être inférieure à %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ fr:
mime_type_pattern_white_list_error: "Vous n'êtes pas autorisé à uploader des fichiers de type %{content_type}"
mime_type_pattern_black_list_error: "Vous n'êtes pas autorisé à uploader des fichiers de type %{content_type}"
rmagick_processing_error: "La manipulation d'image avec rmagick a échoué. Peut-être que ce n'est pas une image ? Erreur originale: %{e}"
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}"
mini_magick_processing_error: "La manipulation d'image avec MiniMagick a échoué. Peut-être que ce n'est pas une image ? Erreur originale: %{e}"
min_size_error: "La taille du fichier doit être supérieure à %{min_size}"
max_size_error: "La taille du fichier doit être inférieure à %{max_size}"
3 changes: 1 addition & 2 deletions lib/carrierwave/locale/id.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ id:
messages:
carrierwave_processing_error: gagal diproses
carrierwave_integrity_error: bukan salah satu tipe file yang diperbolehkan
carrierwave_download_error: gagal download
carrierwave_download_error: gagal download
extension_white_list_error: "Dilarang mengupload tipe file %{extension}, tipe file yang dibolehkan: %{allowed_types}"
extension_black_list_error: "Dilarang mengupload tipe file %{extension}, tipe file yang dilarang: %{prohibited_types}"
mime_type_pattern_white_list_error: "Anda dilarang mengupload file %{content_type}"
mime_type_pattern_black_list_error: "Anda dilarang mengupload file %{content_type}"
rmagick_processing_error: "Gagal memanipulasi dengan rmagick, mungkin file ini bukan gambar?"
mime_types_processing_error: "Gagal memproses file menggunakan MIME::Types, mungkin content-type salah? Error semula: %{e}"
mini_magick_processing_error: "Gagal memanipulasi citra menggunakan MiniMagick, mungkin bukan file gambar? Error semula: %{e}"
min_size_error: "Ukuran file harus lebih besar daripada %{min_size}"
max_size_error: "Ukuran file harus kurang dari %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ja:
extension_white_list_error: "%{extension}ファイルのアップロードは許可されていません。アップロードできるファイルタイプ: %{allowed_types}"
extension_black_list_error: "%{extension}ファイルのアップロードは許可されていません。アップロードできないファイルタイプ: %{prohibited_types}"
rmagick_processing_error: "rmagickがファイルを処理できませんでした。画像を確認してください。エラーメッセージ: %{e}"
mime_types_processing_error: "MIME::Typesのファイルを処理できませんでした。Content-Typeを確認してください。エラーメッセージ: %{e}"
mini_magick_processing_error: "MiniMagickがファイルを処理できませんでした。画像を確認してください。エラーメッセージ: %{e}"
min_size_error: "ファイルを%{min_size}バイト以上のサイズにしてください"
max_size_error: "ファイルを%{max_size}バイト以下のサイズにしてください"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/nb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ nb:
extension_white_list_error: "Du kan ikke laste opp %{extension}-filer, tillatte filtyper: %{allowed_types}"
extension_black_list_error: "Du kan ikke laste opp %{extension}-filer, forbudte filtyper: %{prohibited_types}"
rmagick_processing_error: "Kunne ikke manipulere med rmagick. Er du sikker på at det er et bilde? Feilmelding: %{e}"
mime_types_processing_error: "Kunne ikke behandle fil med MIME::Types. Er du sikker på at content-type er korrekt? Feilmelding: %{e}"
mini_magick_processing_error: "Kunne ikke manipulere med MiniMagick. Er du sikker på at det er et bilde? Feilmelding: %{e}"
min_size_error: "Filen størrelse bør være større enn %{min_size}"
max_size_error: "Filen størrelse bør være mindre enn %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ nl:
extension_white_list_error: "Het is niet toegestaan om %{extension} bestanden te uploaden; toegestane bestandstypes: %{allowed_types}"
extension_black_list_error: "Het is niet toegestaan om %{extension} bestanden te uploaden; verboden bestandstypes: %{prohibited_types}"
rmagick_processing_error: "Bewerking met rmagick is mislukt, misschien is het geen afbeelding? Originele foutmelding: %{e}"
mime_types_processing_error: "Verwerking van bestand met MIME::Types is mislukt, misschien is het geen geldig content-type? Originele foutmelding: %{e}"
mini_magick_processing_error: "Bewerking met MiniMagick is mislukt, misschien is het geen afbeelding? Originele foutmelding: %{e}"
min_size_error: "De bestandsgrootte moet groter zijn dan %{min_size}"
max_size_error: "De bestandsgrootte moet minder zijn dan %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pl:
extension_white_list_error: "Nie można wgrać pliku o rozszerzeniu %{extension}, dozwolone typy plików: %{allowed_types}"
extension_black_list_error: "Nie można wgrać pliku o rozszerzeniu %{extension}, zakazane typy plików: %{prohibited_types}"
rmagick_processing_error: "Nie udało się przetworzyć pliku przy pomocy rmagick, może to nie jest obrazek? Oryginalna treść błędu: %{e}"
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}"
mini_magick_processing_error: "Nie udało się przetworzyć pliku przy pomocy MiniMagick, może to nie jest obrazek? Oryginalna treść błędu: %{e}"
min_size_error: "Rozmiar pliku powinna być większa niż %{min_size}"
max_size_error: "Rozmiar pliku powinna być mniejsza niż %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pt-BR:
extension_white_list_error: "Não é permitido o envio de arquivos %{extension}, tipos permitidos: %{allowed_types}"
extension_black_list_error: "Não é permitido o envio de arquivos %{extension}, tipos proibidos: %{prohibited_types}"
rmagick_processing_error: "Falha ao manipular com RMagick, talvez arquivo não seja uma imagem? Erro original: %{e}"
mime_types_processing_error: "Falha ao processar arquivo com MIME::Types, talvez content-type seja inválido? Erro original: %{e}"
mini_magick_processing_error: "Falha ao manipular com MiniMagick, talvez arquivo não seja uma imagem? Erro original: %{e}"
min_size_error: "O tamanho do arquivo deve ser maior do que %{min_size}"
max_size_error: "O tamanho do arquivo deve ser inferior a %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/pt-PT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pt-PT:
extension_white_list_error: "Não é permitido o envio de ficheiros com a extensão %{extension}, tipos de ficheiro permitidos: %{allowed_types}"
extension_black_list_error: "Não é permitido o envio de ficheiros com a extensão %{extension}, tipos de ficheiro proibidos: %{prohibited_types}"
rmagick_processing_error: "Ocorreu uma falha ao processar com rmagick, talvez o ficheiro não seja uma imagem? Erro original: %{e}"
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}"
mini_magick_processing_error: "Ocorreu uma falha ao processar com MiniMagick, talvez o ficheiro não seja uma imagem? Erro original: %{e}"
min_size_error: "O tamanho do arquivo deve ser maior do que %{min_size}"
max_size_error: "O tamanho do arquivo deve ser inferior a %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ru:
extension_white_list_error: "Вы не можете загружать файлы типа %{extension}, разрешенные типы: %{allowed_types}"
extension_black_list_error: "Вы не можете загружать файлы типа %{extension}, запрещенные типы: %{prohibited_types}"
rmagick_processing_error: "Ошибка взаимодействия с RMagick, может быть это не изображение? Исходная ошибка: %{e}"
mime_types_processing_error: "Не получилось обработать файл с MIME::Types, возможно неправильный content-type? Исходная ошибка: %{e}"
mini_magick_processing_error: "Ошибка взаимодействия с MiniMagick, может быть это не изображение? Исходная ошибка: %{e}"
min_size_error: "Размер файла должен быть больше, чем %{min_size}"
max_size_error: "Размер файла должен быть меньше, чем %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/sk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ sk:
extension_white_list_error: "Nie je možné nahrávať %{extension} súbory, povolené typy: %{allowed_types}"
extension_black_list_error: "Nie je možné nahrávať %{extension} súbory, zakázané typy: %{prohibited_types}"
rmagick_processing_error: "Nepodarilo sa upraviť pomocou rmagick, možno nejde o obrázok? Hlásená chyba: %{e}"
mime_types_processing_error: "Súbor sa nepodarilo spracovať pomocou MIME::Types, možno nejde o valídny content-type? Hlásená chyba: %{e}"
mini_magick_processing_error: "Nepodarilo sa upraviť pomocou MiniMagick, možno nejde o obrázok? Hlásená chyba: %{e}"
min_size_error: "Filstorleken ska vara större än %{min_size}"
max_size_error: "Filstorleken bör vara mindre än %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ tr:
extension_white_list_error: "%{extension} uzantılı dosyaları yükleme izniniz yok, izin verilen uzantılar: %{allowed_types}"
extension_black_list_error: "%{extension} uzantılı dosyaları yükleme izniniz yok, izin verilmeyen uzantılar: %{prohibited_types}"
rmagick_processing_error: "Resim rmagick ile düzenlenemedi, belkide resim değildir? Orjinal Hata: %{e}"
mime_types_processing_error: "Dosya, MIME::Types kullanılarak işlenemedi, belkide geçerli bir içerik türü değildir? Orjinal Hata: %{e}"
mini_magick_processing_error: "Resim MiniMagick ile düzenlenemedi, belkide resim değildir? Orjinal Hata: %{e}"
min_size_error: "Dosya boyutu daha büyük olmalıdır %{min_size}"
max_size_error: "Dosya boyutu daha az olmalıdır %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ zh-CN:
extension_white_list_error: "不可上传 %{extension} 文件, 可上传文件类型为: %{allowed_types}"
extension_black_list_error: "不可上传 %{extension} 文件, 不可上传文件类型为: %{prohibited_types}"
rmagick_processing_error: "rmagick 错误, 也许上传的文件不是图片? 原错误: %{e}"
mime_types_processing_error: "MIME::Types 错误, 也许上传的文件不是正确的content-type? 原错误: %{e}"
mini_magick_processing_error: "MiniMagick 错误, 也许上传的文件不是图片? 原错误: %{e}"
min_size_error: "文件大小应大于 %{min_size}"
max_size_error: "文件的大小应小于 %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/locale/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ zh-TW:
extension_white_list_error: "不可上傳 %{extension} 文件, 可上傳文件類型為: %{allowed_types}"
extension_black_list_error: "不可上傳 %{extension} 文件, 不可上傳文件類型為: %{prohibited_types}"
rmagick_processing_error: "rmagick 錯誤, 也許上傳的的文件不是圖片? 原錯誤: %{e}"
mime_types_processing_error: "MIME::Types 錯誤, 也許上傳的文件不是正確的content-type? 原錯誤: %{e}"
mini_magick_processing_error: "MiniMagick 錯誤, 也許上傳的文件不是圖片? 原錯誤: %{e}"
min_size_error: "文件大小應大於 %{min_size}"
max_size_error: "文件大小應小於 %{max_size}"
1 change: 0 additions & 1 deletion lib/carrierwave/processing.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require "carrierwave/processing/rmagick"
require "carrierwave/processing/mini_magick"
require "carrierwave/processing/mime_types"
require "carrierwave/processing/magic_mime_types"
78 changes: 0 additions & 78 deletions lib/carrierwave/processing/mime_types.rb

This file was deleted.

Loading

0 comments on commit 2fc9ed3

Please sign in to comment.