Parent

Methods

Files

Grit::GitRuby::UserInfo

class for author/committer/tagger lines


class for author/committer/tagger lines

Attributes

date[RW]
email[RW]
name[RW]
offset[RW]

Public Class Methods

new(str) click to toggle source
# File lib/grit/git-ruby/object.rb, line 23
def initialize(str)
  m = /^(.*?) <(.*)> (\d+) ([+-])0*(\d+?)$/.match(str)
  if !m
    raise RuntimeError, "invalid header '%s' in commit" % str
  end
  @name = m[1]
  @email = m[2]
  @date = Time.at(Integer(m[3]))
  @offset = (m[4] == "-" ? -1 : 1)*Integer(m[5])
end

Public Instance Methods

to_s() click to toggle source
# File lib/grit/git-ruby/object.rb, line 34
def to_s
  "%s <%s> %s %+05d" % [@name, @email, @date.to_i, @offset]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.