* ext/pathname/pathname.c (path_inspect): Pathname#inspect translated
from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9006bd2015
commit
b6ebd0622c
@ -1,3 +1,8 @@
|
|||||||
|
Sat Jul 31 23:15:27 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/pathname/pathname.c (path_inspect): Pathname#inspect translated
|
||||||
|
from pathname.rb.
|
||||||
|
|
||||||
Sat Jul 31 15:50:03 2010 Tanaka Akira <akr@fsij.org>
|
Sat Jul 31 15:50:03 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/pathname/pathname.c (Init_pathname): The alias,
|
* ext/pathname/pathname.c (Init_pathname): The alias,
|
||||||
|
@ -31,10 +31,6 @@ class Pathname
|
|||||||
|
|
||||||
# :startdoc:
|
# :startdoc:
|
||||||
|
|
||||||
def inspect # :nodoc:
|
|
||||||
"#<#{self.class}:#{@path}>"
|
|
||||||
end
|
|
||||||
|
|
||||||
# Return a pathname which is substituted by String#sub.
|
# Return a pathname which is substituted by String#sub.
|
||||||
def sub(pattern, *rest, &block)
|
def sub(pattern, *rest, &block)
|
||||||
if block
|
if block
|
||||||
|
@ -141,6 +141,15 @@ path_to_s(VALUE self)
|
|||||||
return rb_obj_dup(get_strpath(self));
|
return rb_obj_dup(get_strpath(self));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* :nodoc: */
|
||||||
|
static VALUE
|
||||||
|
path_inspect(VALUE self)
|
||||||
|
{
|
||||||
|
const char *c = rb_obj_classname(self);
|
||||||
|
VALUE str = get_strpath(self);
|
||||||
|
return rb_sprintf("#<%s:%s>", c, RSTRING_PTR(str));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* == Pathname
|
* == Pathname
|
||||||
*
|
*
|
||||||
@ -336,4 +345,5 @@ Init_pathname()
|
|||||||
rb_define_method(rb_cPathname, "hash", path_hash, 0);
|
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_s", path_to_s, 0);
|
||||||
rb_define_method(rb_cPathname, "to_path", path_to_s, 0);
|
rb_define_method(rb_cPathname, "to_path", path_to_s, 0);
|
||||||
|
rb_define_method(rb_cPathname, "inspect", path_inspect, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user