* test/ruby/test_dir.rb, test/ruby/test_fnmatch.rb: add some tests
(for coverage of dir.c).
* test/ruby/test_enum.rb: add a test for Enumerable#minmax.
* test/ruby/test_enumerator.rb: add some tests for Enumerator#inspect,
Enumerator::Generator and Yielder.
* test/ruby/test_env.rb: add a test for ENV#index.
* test/ruby/test_exception.rb: add some tests (for coverage of
error.c).
* test/ruby/test_hash.rb: add a test for recursive check.
* test/ruby/test_integer.rb: add a test for number of argument of
Integer.
* test/ruby/test_method.rb: add a test for define_method.
* test/ruby/test_module.rb: add a test for constant of included
module.
* test/ruby/test_proc.rb: add a test for parameters with cfunc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(enumerator_next): call ary2sv with dup=0.
(enumerator_peek): call ary2sv with dup=1 to return duplicated array.
(enumerator_peek_values_m): new function to return duplicated array.
(Init_Enumerator): use enumerator_peek_values_m as
Enumerator#peek_value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
and StopIteration#result. [ruby-dev:39109]
(struct enumerator): replace no_next by stop_exc.
new field feedvalue.
(enumerator_mark): mark feedvalue and stop_exc.
(enumerator_init): initialize feedvalue and stop_exc.
(enumerator_init_copy): initialize feedvalue.
(next_ii): send yield arguments as an array. return feedvalue.
(next_i): generate StopIteration exception here. set result.
(next_init): initialize feedvalue.
(enumerator_next_values): new method Enumerator#next_values.
(ary2sv): new function.
(enumerator_peek_values): new method Enumerator#peek_values.
(enumerator_feed): new method Enumerator#feed.
(yielder_yield): return the yield value.
(generator_each): return the iterator value.
(stop_result): new method StopIteration#result.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/ruby/test_enumerator.rb: Add an ability to generate an
enumerator from a block. [experimental] [ruby-dev:35903]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/readline/test_readline_history.rb (Readline#test_each__enumerator),
test/ruby/test_array.rb (TestArray#test_collect),
test/ruby/test_enumerator.rb (TestEnumerator#test_initialize):
Enumerable::Enumerator is now called Enumerator.
* lib/rinda/tuplespace.rb (Rinda::TupleBag#initialize): Use
enum_for instead of hardcoding Enumerable::Enumerator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
the end of each block. [ruby-dev:31470]
* enumerator.c (enumerator_next_p): call init_next if not
initialized. [ruby-dev:31514]
* test/ruby/test_enumerator.rb: add tests for Enumerator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e