summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Sørensen <johan@johansorensen.com>2009-12-11 15:11:19 +0100
committerJohan Sørensen <johan@johansorensen.com>2009-12-11 15:21:43 +0100
commit859cbfc5eac677f41fb0d0c6cdbaccbe7278987c (patch)
tree31380cb70d92695318f55e3aab7d1231e2c7faa2
parent1232709ba6a6017ef7ed7d71a251ff1c9bdec086 (diff)
downloadgitorious-mainline-outdated-859cbfc5eac677f41fb0d0c6cdbaccbe7278987c.zip
gitorious-mainline-outdated-859cbfc5eac677f41fb0d0c6cdbaccbe7278987c.tar.gz
gitorious-mainline-outdated-859cbfc5eac677f41fb0d0c6cdbaccbe7278987c.tar.bz2
Grit: more robust Actor parsing
-rw-r--r--vendor/grit/lib/grit/actor.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/vendor/grit/lib/grit/actor.rb b/vendor/grit/lib/grit/actor.rb
index f642f67..36d276e 100644
--- a/vendor/grit/lib/grit/actor.rb
+++ b/vendor/grit/lib/grit/actor.rb
@@ -1,15 +1,15 @@
module Grit
-
+
class Actor
attr_reader :name
attr_reader :email
-
+
def initialize(name, email)
@name = name
@email = email
end
alias_method :to_s, :name
-
+
# Create an Actor from a string.
# +str+ is the string, which is expected to be in regular git format
#
@@ -20,21 +20,21 @@ module Grit
def self.from_string(str)
case str
when /<.+>/
- m, name, email = *str.match(/(.*) <(.+?)>/)
+ name, email = str.split(/ <(.+)>/)
return self.new(name, email)
else
return self.new(str, nil)
end
end
-
+
# Pretty object inspection
def inspect
%Q{#<Grit::Actor "#{@name} <#{@email}>">}
end
-
+
def ==(other)
name == other.name && email == other.email
end
end # Actor
-
+
end # Grit