From 5bd2ff44209035eb75db20f562ac4c67c50780d2 Mon Sep 17 00:00:00 2001 From: midu Date: Thu, 28 May 2015 11:03:44 -0400 Subject: [PATCH] when available, use mime/types/columnar which is more memory efficient see: https://github.com/mime-types/ruby-mime-types/pull/96 --- lib/refile.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/refile.rb b/lib/refile.rb index 02a78cf8..3e6ee8e3 100644 --- a/lib/refile.rb +++ b/lib/refile.rb @@ -3,7 +3,14 @@ require "tempfile" require "rest_client" require "logger" -require "mime/types" + +begin + + # Use mime/types/columnar if available, for reduced memory usage + require "mime/types/columnar" +rescue LoadError + require "mime/types" +end module Refile # @api private