class Git::Author
An author in a Git commit
@api public
Attributes
@return [Time, nil] the date the change was authored (author date, not committer date)
@return [String, nil] the author’s email
@return [String, nil] the author’s name
Public Class Methods
Source
# File lib/git/author.rb, line 27 def initialize(author_string) return unless (m = /(.*?) <(.*?)> (\d+) (.*)/.match(author_string)) @name = m[1] @email = m[2] @date = Time.at(m[3].to_i) end
Initializes a new Author object from a string
@example
Git::Author.new("John Doe <john.doe@example.com> 1627849923 +0200")
@param author_string [String] the author string
@return [void]