@@ -43,25 +43,25 @@ def safe_concat(string)
43
43
# ==== Examples
44
44
#
45
45
# truncate("Once upon a time in a world far far away")
46
- # # => Once upon a time in a worl ...
46
+ # # => " Once upon a time in a world ..."
47
47
#
48
- # truncate("Once upon a time in a world far far away", :separator => ' ' )
49
- # # => Once upon a time in a world ...
48
+ # truncate("Once upon a time in a world far far away", :length => 17 )
49
+ # # => " Once upon a ti ..."
50
50
#
51
- # truncate("Once upon a time in a world far far away", :length => 14 )
52
- # # => Once upon a...
51
+ # truncate("Once upon a time in a world far far away", :lenght => 17, :separator => ' ' )
52
+ # # => " Once upon a..."
53
53
#
54
- # truncate("And they found that many people were sleeping better.", :omission => " ... (continued)", :length => 25 )
55
- # # => And they f... (continued)
54
+ # truncate("And they found that many people were sleeping better.", :length => 25, : omission => ' ... (continued)' )
55
+ # # => " And they f... (continued)"
56
56
#
57
57
# You can still use <tt>truncate</tt> with the old API that accepts the
58
58
# +length+ as its optional second and the +ellipsis+ as its
59
59
# optional third parameter:
60
60
# truncate("Once upon a time in a world far far away", 14)
61
- # # => Once upon a...
61
+ # # => " Once upon a..."
62
62
#
63
63
# truncate("And they found that many people were sleeping better.", 25, "... (continued)")
64
- # # => And they f... (continued)
64
+ # # => " And they f... (continued)"
65
65
def truncate ( text , *args )
66
66
options = args . extract_options!
67
67
unless args . empty?
0 commit comments