⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (349 Bytes)
Bug #5090
» bug_report.rb
The code that generates the error -
robsyme (Robert Syme)
, 07/24/2011 10:39 PM
enum_a
=
File
.
open
(
ARGV
.
shift
).
each
enum_b
=
File
.
open
(
ARGV
.
shift
).
each
interleaved
=
Enumerator
.
new
do
|
yielder
|
line_a
=
enum_a
.
next
line_b
=
enum_b
.
next
while
line_a
or
line_b
yielder
.
yield
line_a
if
line_a
yielder
.
yield
line_b
if
line_b
line_a
=
enum_a
.
next
line_b
=
enum_b
.
next
end
end
puts
interleaved
.
count
« Previous
1
2
3
…
5
Next »
(1-1/5)
Loading...