WebRI  WebRI::Subversion

Parent

  • Component
[Validate]
Generated with WebRI Redfish 1.2

Subversion

Constants

SVNID_PATTERN

Public Instance Methods

get_svninfo(klass) click to toggle source

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/webri/components/subversion.rb, line 29
    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.now.to_i - commitdate.to_i).time_delta_string,
        :committer   => committer,
      }
    end
initialize_methods() click to toggle source
# File lib/webri/components/subversion.rb, line 17
    def initialize_methods
      provision :svninfo
    end
path() click to toggle source
# File lib/webri/components/subversion.rb, line 11
    def path
      @path ||= Pathname.new(__FILE__).parent
    end
svninfo(klass) click to toggle source
# File lib/webri/components/subversion.rb, line 22
    def svninfo(klass)
      @svninfo ||= {}
      @svninfo[klass] ||= get_svninfo(klass)
    end

Disabled; run with --debug to generate this.