Bug #5425

Improves Array's uniq/uniq! example

Added by Alvaro Pereyra Rabanal over 2 years ago. Updated over 2 years ago.

[ruby-core:40064]
Status:Closed
Priority:Normal
Assignee:Eric Hodel
Category:doc
Target version:1.9.3
ruby -v:trunk Backport:

Description

Updates examples on uniq and uniq! with a more cleaner case. Changes wording to refer a block is possible.

0001-Improves-array-examples-for-uniq-uniq.patch Magnifier (1.93 KB) Alvaro Pereyra Rabanal, 10/09/2011 08:04 AM

0001-Improves-array-content-for-some-methods-and-examples.patch Magnifier (5.75 KB) Alvaro Pereyra Rabanal, 10/10/2011 03:25 AM

Associated revisions

Revision 33453
Added by Eric Hodel over 2 years ago

  • array.c (rbaryinitialize): Improve explanation of Array.new parameters. Patch by Alvaro Pereyra Rabanal. [Ruby 1.9 - Bug #5425]
  • array.c (rbarystryconvert): Fix typo (try => tries)
  • array.c (rbaryrindex): Add spacing for block.
  • array.c (rbaryuniq_bang): Describe block
  • array.c (rbaryuniq): ditto

History

#1 Updated by Benoit Daloze over 2 years ago

There is a typo in the example for uniq:
b.uniq!{ ...

Also, the added description how to pass a block should be the same in uniq and uniq! (I prefer the one of uniq!).

Thanks for documenting in sentences this behavior.

#2 Updated by Alvaro Pereyra Rabanal over 2 years ago

Thanks Benoit. I've fixed that typo and used the same explanation for both uniq and uniq!. Also made some other changes to other sections on the Array.

#3 Updated by Eric Hodel over 2 years ago

Please watch for trailing whitespace in your patches.

#4 Updated by Eric Hodel over 2 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r33453.
Alvaro, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • array.c (rbaryinitialize): Improve explanation of Array.new parameters. Patch by Alvaro Pereyra Rabanal. [Ruby 1.9 - Bug #5425]
  • array.c (rbarystryconvert): Fix typo (try => tries)
  • array.c (rbaryrindex): Add spacing for block.
  • array.c (rbaryuniq_bang): Describe block
  • array.c (rbaryuniq): ditto

#5 Updated by Alvaro Pereyra Rabanal over 2 years ago

Eric Hodel wrote:

Please watch for trailing whitespace in your patches.

Will do. Sorry for that. The idea is to ease your work, not burden it :P.

Also available in: Atom PDF