[DOC] Update an obsolete example for slice_before.

The argument for Enumerable#slice_before is is removed at Ruby 2.3.

Reported by Shyouhei Urabe.  [Bug #13202]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2017-02-09 14:28:27 +00:00
Родитель 3c06d3a6bd
Коммит cd5f5715d7
1 изменённых файлов: 4 добавлений и 3 удалений

7
enum.c
Просмотреть файл

@ -3213,9 +3213,10 @@ slicebefore_i(RB_BLOCK_CALL_FUNC_ARGLIST(yielder, enumerator))
*
* # split mails in mbox (slice before Unix From line after an empty line)
* open("mbox") { |f|
* f.slice_before(emp: true) { |line, h|
* prevemp = h[:emp]
* h[:emp] = line == "\n"
* emp = true
* f.slice_before { |line|
* prevemp = emp
* emp = line == "\n"
* prevemp && line.start_with?("From ")
* }.each { |mail|
* mail.pop if mail.last == "\n"