-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
Milestone
Description
Please, note that Enumerable#find_index on its own works fine. The problem is with Enumerator.
✗ JRUBY_OPTS=--1.9
| . | . |
|---|---|
| JRUBY_VERSION | 1.7.2 |
| JRUBY_REVISION | 302c706 |
| RUBY_VERSION | 1.9.3 |
| ENV_JAVA['jruby.enumerator.lightweight'] | nil |
enum = Enumerator.new { |y| y.yield :fail }
#=> #<Enumerator: ...>
enum.to_a
#=> [:fail]
enum.find_index
#=> #<Enumerator: ...>
enum.find_index(:fail)
#=> 0
enum.find_index { |e| e }
#=> nil
enum.to_a.find_index { |e| e }
#=> 0✓ JRUBY_OPTS=--1.8
| . | . |
|---|---|
| JRUBY_VERSION | 1.7.2 |
| JRUBY_REVISION | 302c706 |
| RUBY_VERSION | 1.8.7 |
| ENV_JAVA['jruby.enumerator.lightweight'] | nil |
require 'generator'
#=> true
enum = Generator.new { |y| y.yield :success }
#=> #<JRuby::Generator::Threaded: ...>
enum.to_a
#=> [:success]
enum.find_index
#=> #<Enumerable::Enumerator: ...>
enum.find_index(:success)
#=> 0
enum.find_index { |e| e }
#=> 0✓ MRI 1.9.3
| . | . |
|---|---|
| RUBY_VERSION | 1.9.3 |
| RUBY_REVISION | 38858 |
enum = Enumerator.new { |y| y.yield :success }
#=> #<Enumerator: ...>
enum.to_a
#=> [:success]
enum.find_index
#=> #<Enumerator: ...>
enum.find_index(:success)
#=> 0
enum.find_index { |e| e }
#=> 0Reactions are currently unavailable