mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/pathname/pathname.c (path_make_link): Pathname#make_link
translated from pathname.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1c8c901e3c
commit
239692dde8
3 changed files with 18 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
|||
Sun Aug 8 19:16:26 2010 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/pathname/pathname.c (path_make_link): Pathname#make_link
|
||||
translated from pathname.rb.
|
||||
|
||||
Sun Aug 8 16:42:48 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/rubygems.rb (Gem.find_files): reverted to use globbing.
|
||||
|
|
|
@ -512,9 +512,6 @@ end
|
|||
|
||||
class Pathname # * File *
|
||||
|
||||
# See <tt>File.link</tt>. Creates a hard link.
|
||||
def make_link(old) File.link(old, @path) end
|
||||
|
||||
# See <tt>File.open</tt>. Opens the file for reading or writing.
|
||||
def open(*args, &block) # :yield: file
|
||||
File.open(@path, *args, &block)
|
||||
|
|
|
@ -324,6 +324,18 @@ path_ftype(VALUE self)
|
|||
return rb_funcall(rb_cFile, rb_intern("ftype"), 1, get_strpath(self));
|
||||
}
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* pathname.make_link(old)
|
||||
*
|
||||
* See <tt>File.link</tt>. Creates a hard link at _pathname_.
|
||||
*/
|
||||
static VALUE
|
||||
path_make_link(VALUE self, VALUE old)
|
||||
{
|
||||
return rb_funcall(rb_cFile, rb_intern("link"), 2, old, get_strpath(self));
|
||||
}
|
||||
|
||||
/*
|
||||
* == Pathname
|
||||
*
|
||||
|
@ -534,4 +546,5 @@ Init_pathname()
|
|||
rb_define_method(rb_cPathname, "fnmatch", path_fnmatch, -1);
|
||||
rb_define_method(rb_cPathname, "fnmatch?", path_fnmatch, -1);
|
||||
rb_define_method(rb_cPathname, "ftype", path_ftype, 0);
|
||||
rb_define_method(rb_cPathname, "make_link", path_make_link, 1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue