| Path: | StdlibDoc/Status/Verifier.rb |
| Last Update: | Fri Oct 31 18:26:40 GMT+10:00 2003 |
Verifier.rb -
Verifies a Status object for general validity:
- path must be a String and look like a file path
- loc must be a hash with the correct keys and value types
- status must be an acceptable value (according to the spec within the
Status object)
- priority must match [HML]
- score must be 1-10
- owner must be a known contributor
- contributor likewise, except "author" is allowed
- committed must be a Date
- comment must be a String
The above specs assume that a value is given for everything. In fact, the
only non-null fields is path, although there are some complicated
permutations below.
WARNINGS
The above specs are to raise errors; those below raise warnings (see what
"raise" means in the next section).
- loc should be given unless path ends in "*"
- priority should be given unless status is obsolete or ignore
- score should be given if status is done or if contributor is given
- committed should be given if status is done
- comment should be given if status is ignore or obsolete
- ...
ERRORS and WARNINGS
When a Status object is verified, no news is good news. If any of the above
conditions is violated, an error or warning object is created, but the
verification goes on. The user or program seeking verification is given as
much information as possible. Upshot, the return value is a hash:
path => [errors and warnings]
I have yet to think hard about the structure of errors and warnings, but it
would be something like this:
- path
- :error or :warning
- field
- message