mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/pathname/pathname.c (Init_pathname): The alias,
Pathname#to_path, is translated from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0794c1da93
commit
9006bd2015
3 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat Jul 31 15:50:03 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/pathname/pathname.c (Init_pathname): The alias,
|
||||
Pathname#to_path, is translated from pathname.rb.
|
||||
|
||||
Sat Jul 31 09:12:36 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/pathname/pathname.c (path_to_s): Pathname#to_s translated
|
||||
|
|
|
@ -31,9 +31,6 @@ class Pathname
|
|||
|
||||
# :startdoc:
|
||||
|
||||
# to_path is implemented so Pathname objects are usable with File.open, etc.
|
||||
alias_method TO_PATH, :to_s
|
||||
|
||||
def inspect # :nodoc:
|
||||
"#<#{self.class}:#{@path}>"
|
||||
end
|
||||
|
|
|
@ -127,7 +127,13 @@ path_hash(VALUE self)
|
|||
}
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* pathname.to_s => string
|
||||
* pathname.to_path => string
|
||||
*
|
||||
* Return the path as a String.
|
||||
*
|
||||
* to_path is implemented so Pathname objects are usable with File.open, etc.
|
||||
*/
|
||||
static VALUE
|
||||
path_to_s(VALUE self)
|
||||
|
@ -329,4 +335,5 @@ Init_pathname()
|
|||
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);
|
||||
rb_define_method(rb_cPathname, "to_path", path_to_s, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue