Project

General

Profile

Bug #9814

Improving documentation example for Enumerator#peek

Added by futureperfect (Erik Hollembeak) about 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
[ruby-core:62462]

Description

The existing example for Enumerator#peek doesn't effectively document the behavior when peeking after an enumerator has been entirely consumed. Rather, it documents the behavior of Enumerator#next.

This change more effectively demonstrates that StopIteration is raised when peeking beyond the end of the enumerator.


Files

0001-Improving-example-for-Enumerator-peek.patch (861 Bytes) 0001-Improving-example-for-Enumerator-peek.patch futureperfect (Erik Hollembeak), 05/08/2014 08:03 AM

Updated by zzak (Zachary Scott) about 6 years ago

  • Status changed from Open to Assigned
  • Assignee changed from drbrain (Eric Hodel) to zzak (Zachary Scott)

Updated by zzak (Zachary Scott) about 6 years ago

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

Applied in changeset r46099.


  • enumerator.c: [DOC] Fix example to show Enumerator#peek behavior Patch by Erik Hollembeak [Bug #9814] [ci skip]

Updated by usa (Usaku NAKAMURA) almost 6 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: REQUIRED, 2.1: REQUIRED

Updated by nagachika (Tomoyuki Chikanaga) almost 6 years ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE

Backported into ruby_2_1 branch at r46677.

Updated by usa (Usaku NAKAMURA) almost 6 years ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: DONE, 2.1: DONE

backported into ruby_2_0_0 at r46745.

Also available in: Atom PDF