--B_3270986178_21347256
Content-type: text/plain;
	charsetS-ASCII"
Content-transfer-encoding: 7bit

Hey all, here's another one for you.  I admit that there isn't anything
special about it... I think it's one of the more direct solutions (i.e.
Nothing clever here guys).  I didn't see a reason to include the entire
genre, so it's attached in a separate file.  It simply declares a constant
(an array which is indexed in read_tags).

Tom


--BEGIN SOLUTION--
require 'id3_tag_genre'

class NoTagError < RuntimeError; end

class Mp3
  attr_reader :song, :artist, :album, :year, :comment, :genre, :track
  
  def initialize(file)
    read_tags(file)
  end
  
  def read_tags(file)
    begin
      size  ile.stat(file).size
      f  ile.open(file)
      f.pos  ize - 128
      tag  .read
      raise NoTagError unless tag[0..2] "TAG"
      @song  ag[3..32].strip
      @artist  ag[33..62].strip
      @album  ag[63..92].strip
      @year  ag[93..96].strip
      @comment  ag[97..126]
        if @comment[28] 0 && @comment[29] ! 
          @track  comment[29..29].to_i
          @comment  comment[0..28].strip
        end
      @genre  enre[tag[127]]
    rescue NoTagError
      puts "No tags found!"
      return false
    end
    true
  end
end


--B_3270986178_21347256
Content-type: application/octet-stream; name="id3_tag_genre.rb"
Content-disposition: attachment;
	filenamed3_tag_genre.rb"
Content-transfer-encoding: base64

R2VucmUgPSAiQmx1ZXMKQ2xhc3NpYyBSb2NrCkNvdW50cnkKRGFuY2UKRGlzY28KRnVuawpH
cnVuZ2UKSGlwLUhvcApKYXp6Ck1ldGFsCk5ldyBBZ2UKT2xkaWVzCk90aGVyClBvcApSJkIK
UmFwClJlZ2dhZQpSb2NrClRlY2hubwpJbmR1c3RyaWFsCkFsdGVybmF0aXZlClNrYQpEZWF0
aCBNZXRhbApQcmFua3MKU291bmR0cmFjawpFdXJvLVRlY2hubwpBbWJpZW50ClRyaXAtSG9w
ClZvY2FsCkphenorRnVuawpGdXNpb24KVHJhbmNlCkNsYXNzaWNhbApJbnN0cnVtZW50YWwK
QWNpZApIb3VzZQpHYW1lClNvdW5kIENsaXAKR29zcGVsCk5vaXNlCkFsdGVyblJvY2sKQmFz
cwp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