diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-10-18 23:00:19 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2010-10-18 23:00:19 -0700 |
commit | 05f4f07b2fdc52395bed6505f14ade137812e821 (patch) | |
tree | 1eb47ac91b60891326bbc49fedfd13451251758f | |
parent | 0d2a65126180faa8dda2398553438ecc925c17c3 (diff) | |
download | omptagger-05f4f07b2fdc52395bed6505f14ade137812e821.tar.gz omptagger-05f4f07b2fdc52395bed6505f14ade137812e821.tar.xz |
Use a class variable for FileMagic.
-rwxr-xr-x | omptagger | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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' |