We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad86038 commit eb89cd5Copy full SHA for eb89cd5
lib/git/author.rb
@@ -2,18 +2,20 @@ module Git
2
class Author
3
attr_accessor :name, :email, :date
4
5
- def initialize(author_string)
+ def initialize(author_string = nil)
6
if m = /(.*?) <(.*?)> (\d+) (.*)/.match(author_string)
7
@name = m[1]
8
@email = m[2]
9
@date = Time.at(m[3].to_i)
10
end
11
12
13
- def initialize(name, email, date = Time.now)
14
- @name = name
15
- @email = email
16
- @date = date
+ def self.from_parts(name, email, date = Time.now)
+ a = Author.new
+ a.name = name
+ a.email = email
17
+ a.date = date
18
+ return a
19
20
21
0 commit comments