Sha256: 52bac7e53e7692bf7ab4ecab324c73c97b907b80ab2c114d059873fec07fd8e8

Contents?: true

Size: 441 Bytes

Versions: 2

Compression:

Stored size: 441 Bytes

Contents

module Git
  class Author
    attr_accessor :name, :email, :date
    
    def initialize(author_string = nil)
      if m = /(.*?) <(.*?)> (\d+) (.*)/.match(author_string)
        @name = m[1]
        @email = m[2]
        @date = Time.at(m[3].to_i)
      end
    end
    
    def self.from_parts(name, email, date = Time.now)
      a = Author.new
      a.name = name
      a.email = email
      a.date = date
      return a
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
peterwald-git-1.1.3 lib/git/author.rb
peterwald-git-1.1.4 lib/git/author.rb