diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/abbrev.rb | 19 |
2 files changed, 15 insertions, 9 deletions
@@ -1,3 +1,8 @@ +Wed Apr 11 05:14:51 2012 Eric Hodel <drbrain@segment7.net> + + * lib/abbrev.rb: Clarified that Abbrev.abbrev returns a Hash instead + of an Array. Patch by Andrei Bocan. [ruby-trunk - Bug #6107] + Wed Apr 11 03:02:24 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com> * ext/ripper/lib/ripper/sexp.rb: fix spelling. patched by diff --git a/lib/abbrev.rb b/lib/abbrev.rb index e6e810bf69..d3ef272219 100644 --- a/lib/abbrev.rb +++ b/lib/abbrev.rb @@ -10,22 +10,23 @@ # $Id$ #++ -# Calculate the set of unique abbreviations for a given set of strings. +## +# Calculates the set of unique abbreviations for a given set of strings. # # require 'abbrev' # require 'pp' # -# pp Abbrev::abbrev(['ruby', 'rules']).sort +# pp Abbrev.abbrev(['ruby', 'rules']) # -# <i>Generates:</i> +# Generates: # -# [["rub", "ruby"], -# ["ruby", "ruby"], -# ["rul", "rules"], -# ["rule", "rules"], -# ["rules", "rules"]] +# { "rub" => "ruby", +# "ruby" => "ruby", +# "rul" => "rules", +# "rule" => "rules", +# "rules" => "rules" } # -# Also adds an +abbrev+ method to class +Array+. +# It also adds an +abbrev+ method to class Array. module Abbrev |