Skip to content

Commit

Permalink
Merge from ruby_1_8.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7@16171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
knu committed Apr 23, 2008
1 parent 7ef612f commit ad72d31
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Wed Apr 23 14:00:05 2008 Akinori MUSHA <knu@iDaemons.org>

* lib/mkmf.rb (create_makefile): Add a missing dependency on the
target directory for each .rb file. This will hopefully fix
parallel make (-jN). Tested on FreeBSD.

Wed Apr 23 11:49:54 2008 Akinori MUSHA <knu@iDaemons.org>

* lib/set.rb (Set#each, SortedSet#each, TC_Set#test_each): Return
an enumerator if no block is given.

Wed Apr 23 00:42:49 2008 Tanaka Akira <akr@fsij.org>

* eval.c (error_print): show full stack grace except SystemStackError.
Expand Down
2 changes: 1 addition & 1 deletion lib/mkmf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ def create_makefile(target, srcprefix = nil)
files.each do |f|
dest = "#{dir}/#{File.basename(f)}"
mfile.print("install-rb#{sfx}: #{dest}\n")
mfile.print("#{dest}: #{f}\n\t$(#{$extout ? 'COPY' : 'INSTALL_DATA'}) ")
mfile.print("#{dest}: #{f} #{dir}\n\t$(#{$extout ? 'COPY' : 'INSTALL_DATA'}) ")
sep = config_string('BUILD_FILE_SEPARATOR')
if sep
f = f.gsub("/", sep)
Expand Down
12 changes: 7 additions & 5 deletions lib/set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#--
# set.rb - defines the Set class
#++
# Copyright (c) 2002 Akinori MUSHA <knu@iDaemons.org>
# Copyright (c) 2002-2008 Akinori MUSHA <knu@iDaemons.org>
#
# Documentation by Akinori MUSHA and Gavin Sinclair.
#
Expand Down Expand Up @@ -188,8 +188,10 @@ def proper_subset?(set)
end

# Calls the given block once for each element in the set, passing
# the element as parameter.
# the element as parameter. Returns an enumerator if no block is
# given.
def each
block_given? or return enum_for(__method__)
@hash.each_key { |o| yield(o) }
self
end
Expand Down Expand Up @@ -501,6 +503,7 @@ def merge(enum)
end
def each
block_given? or return enum_for(__method__)
to_a.each { |o| yield(o) }
end
Expand Down Expand Up @@ -918,9 +921,8 @@ def test_each
ary = [1,3,5,7,10,20]
set = Set.new(ary)

assert_raises(LocalJumpError) {
set.each
}
e = set.each
assert_instance_of(Enumerable::Enumerator, e)

assert_nothing_raised {
set.each { |o|
Expand Down

0 comments on commit ad72d31

Please sign in to comment.