зеркало из https://github.com/github/ruby.git
* ext/pathname/pathname.c (path_to_s): Pathname#to_s translated
from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
faca64d5dd
Коммит
c57e8f7ddc
|
@ -1,3 +1,8 @@
|
|||
Sat Jul 31 09:12:36 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/pathname/pathname.c (path_to_s): Pathname#to_s translated
|
||||
from pathname.rb.
|
||||
|
||||
Sat Jul 31 08:20:07 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
||||
|
||||
* lib/webrick/ssl.rb (WEBrick::Utils.create_self_signed_cert):
|
||||
|
|
|
@ -31,11 +31,6 @@ class Pathname
|
|||
|
||||
# :startdoc:
|
||||
|
||||
# Return the path as a String.
|
||||
def to_s
|
||||
@path.dup
|
||||
end
|
||||
|
||||
# to_path is implemented so Pathname objects are usable with File.open, etc.
|
||||
alias_method TO_PATH, :to_s
|
||||
|
||||
|
|
|
@ -126,6 +126,15 @@ path_hash(VALUE self)
|
|||
return INT2FIX(rb_str_hash(get_strpath(self)));
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the path as a String.
|
||||
*/
|
||||
static VALUE
|
||||
path_to_s(VALUE self)
|
||||
{
|
||||
return rb_obj_dup(get_strpath(self));
|
||||
}
|
||||
|
||||
/*
|
||||
* == Pathname
|
||||
*
|
||||
|
@ -319,4 +328,5 @@ Init_pathname()
|
|||
rb_define_method(rb_cPathname, "eql?", path_eq, 1);
|
||||
rb_define_method(rb_cPathname, "<=>", path_cmp, 1);
|
||||
rb_define_method(rb_cPathname, "hash", path_hash, 0);
|
||||
rb_define_method(rb_cPathname, "to_s", path_to_s, 0);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче