Try to extract Subversion information out of the first constant whose value
looks like a subversion Id tag. If no matching constant is found, and empty
hash is returned.
# File lib/rdoc/generator/darkfish.rb, line 318
def get_svninfo( klass )
constants = klass.constants or return {}
constants.find {|c| c.value =~ SVNID_PATTERN } or return {}
filename, rev, date, time, committer = $~.captures
commitdate = Time.parse( date + ' ' + time )
return {
:filename => filename,
:rev => Integer( rev ),
:commitdate => commitdate,
:commitdelta => time_delta_string( Time.now.to_i - commitdate.to_i ),
:committer => committer,
}
end