Skip to content

Instantly share code, notes, and snippets.

@furu
Last active August 29, 2015 14:23
Show Gist options
  • Save furu/7d3a1f12fcb06dd3da6b to your computer and use it in GitHub Desktop.
Save furu/7d3a1f12fcb06dd3da6b to your computer and use it in GitHub Desktop.

Ruby でファイルの拡張子ではなく、中身からそのファイルが何なのかを判別したい

  • ruby-mime-types
    • ファイルの拡張子から判別するのでだめだ
  • minad-mimemagic
    • 拡張子と中身から判別するっぽい
    • GitHub にリポジトリがなく、最終リリース日が2009年
  • mime-typer
    • file と awk を使う
    • file のラッパーみたいなもの
  • mimer
    • file のラッパー
  • mimemagic
    • pure ruby 実装
    • 拡張子と中身から判別できる
  • shared-mime-info
    • pure ruby 実装
  • ruby-filemagic
    • libmagic のバインディング
  • magic
    • libmagic のバインディング
  • ffi-magic
    • libmagic のバインディング
  • ruby-magic
    • libmagic のバインディング
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment