Class FInfo
In: mkcddb/mkcddb.rb
Parent: Object
Methods
new    readdir   
Attributes
:dir  [R] 
:length  [R] 
:path  [R] 
:title  [R] 
:trknum  [R] 
Public Class methods
new()
# File mkcddb/mkcddb.rb, line 57
  def initialize; end
Public Instance methods
readdir(dir)

Info about a file is kept here.

# File mkcddb/mkcddb.rb, line 60
  def readdir(dir)
    @dir = dir
    files = Array.new
    filesInDir = Hash.new
    Find.find(@dir) { |f| files << f if f =~ /(\d\d)-([a-z_]+)\.mp3/ }
    files.each {
      |file|
      filebase = File.basename(file)
      titlebase = filebase[3, filebase.size - 7]
      next if titlebase == "data" || titlebase =~ /(missing|null)(_?\d+)?/
      @trknum = filebase[0,2]
      @path = File.expand_path(file)
      length = Mp3Info.new(file).length
      @length = SecsFrames.new(length)
      @title = titlebase.split(/_+/).map { |s| s.tr("_"," ").capitalize }.join(" ")
      filesInDir[@trknum] = self.clone
    }
    filesInDir
  end