Hi, I am currently writting a module for reading id3 v1, v1.1 & v2.x
tags. I figured the best way to learn was to rubyfying a playlist
generator I’d previously written in java.
I have a method for reading the tag data from the file. At present I am
asserting that certain conditions must exist i.e. the file must exist &
that the file is readable. (slightly reformated for posting)
raise ArgumentError, “File does not exist”
unless FileTest.exist? filename
raise IOError, “File is not readable”
unless FileTest.readable? filename
As the developer I know I can stipulate that this is how the module
should be used. A contract, as such, that says give me a real readable
file and I’ll get the tag data.
However is this the right / best / most sensible way to go about it?