summaryrefslogtreecommitdiffstats
path: root/lib/git/author.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git/author.rb')
-rw-r--r--lib/git/author.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/git/author.rb b/lib/git/author.rb
new file mode 100644
index 0000000..545abb9
--- /dev/null
+++ b/lib/git/author.rb
@@ -0,0 +1,14 @@
+module Git
+ class Author
+ attr_accessor :name, :email, :date
+
+ def initialize(author_string)
+ if m = /(.*?) <(.*?)> (\d+) (.*)/.match(author_string)
+ @name = m[1]
+ @email = m[2]
+ @date = Time.at(m[3].to_i)
+ end
+ end
+
+ end
+end \ No newline at end of file