mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/pathname/pathname.c (path_lchown): Pathname#lchown translated
from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f6404fa6d5
commit
49cb5a78a1
4 changed files with 15 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Aug 7 18:20:41 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/pathname/pathname.c (path_lchown): Pathname#lchown translated
|
||||||
|
from pathname.rb.
|
||||||
|
|
||||||
Sat Aug 7 17:49:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Aug 7 17:49:10 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* include/ruby/missing.h: moved BROKEN_CLOSE replacements from
|
* include/ruby/missing.h: moved BROKEN_CLOSE replacements from
|
||||||
|
|
|
@ -512,9 +512,6 @@ end
|
||||||
|
|
||||||
class Pathname # * File *
|
class Pathname # * File *
|
||||||
|
|
||||||
# See <tt>File.lchown</tt>.
|
|
||||||
def lchown(owner, group) File.lchown(owner, group, @path) end
|
|
||||||
|
|
||||||
# See <tt>File.fnmatch</tt>. Return +true+ if the receiver matches the given
|
# See <tt>File.fnmatch</tt>. Return +true+ if the receiver matches the given
|
||||||
# pattern.
|
# pattern.
|
||||||
def fnmatch(pattern, *args) File.fnmatch(pattern, @path, *args) end
|
def fnmatch(pattern, *args) File.fnmatch(pattern, @path, *args) end
|
||||||
|
|
|
@ -286,6 +286,15 @@ path_chown(VALUE self, VALUE owner, VALUE group)
|
||||||
return rb_funcall(rb_cFile, rb_intern("chown"), 3, owner, group, get_strpath(self));
|
return rb_funcall(rb_cFile, rb_intern("chown"), 3, owner, group, get_strpath(self));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* See <tt>File.lchown</tt>.
|
||||||
|
*/
|
||||||
|
static VALUE
|
||||||
|
path_lchown(VALUE self, VALUE owner, VALUE group)
|
||||||
|
{
|
||||||
|
return rb_funcall(rb_cFile, rb_intern("lchown"), 3, owner, group, get_strpath(self));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* == Pathname
|
* == Pathname
|
||||||
*
|
*
|
||||||
|
@ -492,4 +501,5 @@ Init_pathname()
|
||||||
rb_define_method(rb_cPathname, "chmod", path_chmod, 1);
|
rb_define_method(rb_cPathname, "chmod", path_chmod, 1);
|
||||||
rb_define_method(rb_cPathname, "lchmod", path_lchmod, 1);
|
rb_define_method(rb_cPathname, "lchmod", path_lchmod, 1);
|
||||||
rb_define_method(rb_cPathname, "chown", path_chown, 2);
|
rb_define_method(rb_cPathname, "chown", path_chown, 2);
|
||||||
|
rb_define_method(rb_cPathname, "lchown", path_lchown, 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -738,7 +738,6 @@ class TestPathname < Test::Unit::TestCase
|
||||||
File.symlink("a", "l")
|
File.symlink("a", "l")
|
||||||
path = Pathname("l")
|
path = Pathname("l")
|
||||||
old = path.lstat.mode
|
old = path.lstat.mode
|
||||||
assert_normal_exit %{ require "pathname"; Pathname("foo").lchmod(nil) }
|
|
||||||
begin
|
begin
|
||||||
path.lchmod(0444)
|
path.lchmod(0444)
|
||||||
rescue NotImplementedError
|
rescue NotImplementedError
|
||||||
|
|
Loading…
Add table
Reference in a new issue