* lib/abbrev.rb: Fixed typo in abbrev pattern documentation. Based on
patch by Mark Rushakoff. [ruby-trunk - #6346] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c047e1ec12
commit
79f28211fd
@ -1,3 +1,8 @@
|
|||||||
|
Tue May 8 08:54:48 2012 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
|
* lib/abbrev.rb: Fixed typo in abbrev pattern documentation. Based on
|
||||||
|
patch by Mark Rushakoff. [ruby-trunk - #6346]
|
||||||
|
|
||||||
Tue May 8 07:44:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
Tue May 8 07:44:18 2012 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* ext/openssl/ossl_ssl.c (ossl_start_ssl): remove useless rb_sys_fail
|
* ext/openssl/ossl_ssl.c (ossl_start_ssl): remove useless rb_sys_fail
|
||||||
|
@ -38,8 +38,8 @@ module Abbrev
|
|||||||
# would be "co", "con", and "cone".
|
# would be "co", "con", and "cone".
|
||||||
#
|
#
|
||||||
# The optional +pattern+ parameter is a pattern or a string. Only
|
# The optional +pattern+ parameter is a pattern or a string. Only
|
||||||
# those input strings matching the pattern, or begging the string,
|
# input strings that match the pattern or start with the string
|
||||||
# are considered for inclusion in the output hash
|
# are included in the output hash.
|
||||||
|
|
||||||
def abbrev(words, pattern = nil)
|
def abbrev(words, pattern = nil)
|
||||||
table = {}
|
table = {}
|
||||||
@ -81,12 +81,17 @@ end
|
|||||||
|
|
||||||
class Array
|
class Array
|
||||||
# Calculates the set of unambiguous abbreviations for the strings in
|
# Calculates the set of unambiguous abbreviations for the strings in
|
||||||
# +self+. If passed a pattern or a string, only the strings matching
|
# +self+.
|
||||||
# the pattern or starting with the string are considered.
|
#
|
||||||
|
# The optional +pattern+ parameter is a pattern or a string. Only
|
||||||
|
# input strings that match the pattern or start with the string
|
||||||
|
# are included in the output hash.
|
||||||
#
|
#
|
||||||
# %w{ car cone }.abbrev #=> { "ca" => "car", "car" => "car",
|
# %w{ car cone }.abbrev #=> { "ca" => "car", "car" => "car",
|
||||||
# "co" => "cone", "con" => "cone",
|
# "co" => "cone", "con" => "cone",
|
||||||
# "cone" => "cone" }
|
# "cone" => "cone" }
|
||||||
|
#
|
||||||
|
# See also Abbrev#abbrev
|
||||||
def abbrev(pattern = nil)
|
def abbrev(pattern = nil)
|
||||||
Abbrev::abbrev(self, pattern)
|
Abbrev::abbrev(self, pattern)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user