public
Fork of mojombo/grit
Description: Grit is a Ruby library for extracting information from a git repository in an object oriented manner.
Homepage: http://grit.rubyforge.org/
Clone URL: git://github.com/dustin/grit.git
Search Repo:
add Actor#to_s as alias to Actor#name
defunkt (author)
Sun Oct 28 22:24:06 -0700 2007
commit  02617bd0f7cae462e71be075c99385f709279533
tree    faa81ee0f836ea8d954fba1fa088a40cfbe9cdf4
parent  5f141d9c0181b8732c0ec2fab4967f0ffa24fa3f
...
8
9
10
 
11
12
13
...
32
33
34
35
36
 
...
8
9
10
11
12
13
14
...
33
34
35
 
36
37
0
@@ -8,6 +8,7 @@ module Grit
0
       @name = name
0
       @email = email
0
     end
0
+ alias_method :to_s, :name
0
     
0
     # Create an Actor from a string.
0
     # +str+ is the string, which is expected to be in regular git format
0
@@ -32,4 +33,4 @@ module Grit
0
     end
0
   end # Actor
0
   
0
-end # Grit
0
\ No newline at end of file
0
+end # Grit
...
25
26
27
28
29
 
 
 
 
 
 
 
 
...
25
26
27
 
28
29
30
31
32
33
34
35
36
0
@@ -25,4 +25,11 @@ class TestActor < Test::Unit::TestCase
0
     a = Actor.from_string("Tom Werner <tom@example.com>")
0
     assert_equal %Q{#<Grit::Actor "Tom Werner <tom@example.com>">}, a.inspect
0
   end
0
-end
0
\ No newline at end of file
0
+
0
+ # to_s
0
+
0
+ def test_to_s_should_alias_name
0
+ a = Actor.from_string("Tom Werner <tom@example.com>")
0
+ assert_equal a.name, a.to_s
0
+ end
0
+end

Comments

    No one has commented yet.