From 05f4f07b2fdc52395bed6505f14ade137812e821 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Mon, 18 Oct 2010 23:00:19 -0700 Subject: Use a class variable for FileMagic. --- omptagger | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/omptagger b/omptagger index 59c4f12..e5e4ad3 100755 --- a/omptagger +++ b/omptagger @@ -112,6 +112,9 @@ Tag Generation: end class Datum + @@mime = FileMagic.mime + @@mime.simplified = true + def initialize(filename) raise 'File does not exist.' unless File.exist?(filename) @@ -119,10 +122,7 @@ class Datum @filename = File.expand_path(filename) - mime = FileMagic.mime - mime.simplified = true - - case mime.file(@filename) + case @@mime.file(@filename) when 'audio/x-flac' type = FLAC when 'application/ogg' -- cgit v1.2.3-70-g09d2