summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-08 08:12:08 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-08 08:12:08 +0000
commit2c247e3d6bf178c4b19c87b6c55635467624864f (patch)
tree23dc7651a8817f9242a155cd33c47ead87a3fa51
parent8d7d25a0545296a1b9df506a8ab9fe930929ab6a (diff)
* io.c (rb_f_open): open should not ignore block when "to_open"
method is used. [ruby-dev:23478] * ext/dbm/dbm.c (fdbm_modify): typo fixed. [ruby-dev:23473] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--ext/dbm/dbm.c4
-rw-r--r--ext/gdbm/gdbm.c4
-rw-r--r--ext/sdbm/init.c4
-rw-r--r--io.c6
-rw-r--r--lib/pathname.rb4
6 files changed, 17 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index aa88bbdc3f..7118611d7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat May 8 10:53:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (rb_f_open): open should not ignore block when "to_open"
+ method is used. [ruby-dev:23478]
+
Fri May 7 22:07:39 2004 Minero Aoki <aamine@loveruby.net>
* lib/fileutils.rb (mv): new option `force'. [ruby-talk:99457]
@@ -22,6 +27,10 @@ Fri May 7 21:03:51 2004 Minero Aoki <aamine@loveruby.net>
* test/fileutils/test_fileutils.rb (mkdir): test "\n" in path.
+Fri May 7 20:53:25 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * ext/dbm/dbm.c (fdbm_modify): typo fixed. [ruby-dev:23473]
+
Fri May 7 11:17:27 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* util.c (ruby_strtod): 0.0000000000000000001 == 0.0 should be false.
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 1e4fe00fe7..e9e2a6e1e9 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -285,9 +285,7 @@ fdbm_modify(obj)
VALUE obj;
{
rb_secure(4);
- if (OBJ_FROZEN_P(obj)) {
- if (OBJ_FROZEN(obj)) rb_error_frozen("DBM");
- }
+ if (OBJ_FROZEN(obj)) rb_error_frozen("DBM");
}
static VALUE
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index 705cecfa97..799445a89c 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -392,9 +392,7 @@ rb_gdbm_modify(obj)
VALUE obj;
{
rb_secure(4);
- if (OBJ_FROZEN_P(obj)) {
- if (OBJ_FROZEN(obj)) rb_error_frozen("GDBM");
- }
+ if (OBJ_FROZEN(obj)) rb_error_frozen("GDBM");
}
static VALUE
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index 77b27afe5b..2dfd17196c 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -273,9 +273,7 @@ fdbm_modify(obj)
VALUE obj;
{
rb_secure(4);
- if (OBJ_FROZEN_P(obj)) {
- if (OBJ_FROZEN(obj)) rb_error_frozen("SDBM");
- }
+ if (OBJ_FROZEN(obj)) rb_error_frozen("SDBM");
}
static VALUE
diff --git a/io.c b/io.c
index 9765fa7566..f2f46a64fc 100644
--- a/io.c
+++ b/io.c
@@ -3071,7 +3071,11 @@ rb_f_open(argc, argv)
ID to_open = rb_intern("to_open");
if (rb_respond_to(argv[0], to_open)) {
- return rb_funcall2(argv[0], to_open, argc-1, argv+1);
+ VALUE io = rb_funcall2(argv[0], to_open, argc-1, argv+1);
+ if (rb_block_given_p()) {
+ return rb_ensure(rb_yield, io, io_close, io);
+ }
+ return io;
}
else {
VALUE tmp = rb_check_string_type(argv[0]);
diff --git a/lib/pathname.rb b/lib/pathname.rb
index 20cff4f097..4d05b6f38c 100644
--- a/lib/pathname.rb
+++ b/lib/pathname.rb
@@ -234,10 +234,6 @@ class Pathname
"#<#{self.class}:#{@path}>"
end
- def to_open(*args) # :nodoc:
- Kernel::open(@path, *args)
- end
-
#
# Returns clean pathname of +self+ with consecutive slashes and useless dots
# removed. The filesystem is not accessed.