Project

General

Profile

Bug #6346 ยป 0001-Fix-doc-typo-in-abbrev.rb.patch

mark-rushakoff (Mark Rushakoff), 04/24/2012 12:00 PM

View differences:

lib/abbrev.rb
# would be "co", "con", and "cone".
#
# The optional +pattern+ parameter is a pattern or a string. Only
# those input strings matching the pattern, or begging the string,
# are considered for inclusion in the output hash
# input strings that match the pattern or start with the string
# are considered to be included in the output hash.
def abbrev(words, pattern = nil)
table = {}
......
class Array
# Calculates the set of unambiguous abbreviations for the strings in
# +self+. If passed a pattern or a string, only the strings matching
# the pattern or starting with the string are considered.
# the pattern or starting with the string are considered to be
# included in the output hash.
#
# %w{ car cone }.abbrev #=> { "ca" => "car", "car" => "car",
# "co" => "cone", "con" => "cone",
    (1-1/1)