mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* array.c (push_values_at): Array#values_at should work with
ranges too. * range.c (rb_range_beg_len): length calculation was wrong. * eval.c (rb_call): should set T_ICLASS in the frame->last_class. [ruby-core:01110] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f5a7f85917
commit
6125313d69
12 changed files with 114 additions and 57 deletions
|
|
@ -39,7 +39,7 @@ class << File
|
|||
end
|
||||
|
||||
def copy from, to, verbose = false
|
||||
$stderr.print from, " -> ", catname(from, to), "\n" if verbose
|
||||
$deferr.print from, " -> ", catname(from, to), "\n" if verbose
|
||||
syscopy from, to
|
||||
end
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ class << File
|
|||
|
||||
def move from, to, verbose = false
|
||||
to = catname(from, to)
|
||||
$stderr.print from, " -> ", to, "\n" if verbose
|
||||
$deferr.print from, " -> ", to, "\n" if verbose
|
||||
|
||||
if RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw/ and FileTest.file? to
|
||||
unlink to
|
||||
|
|
@ -79,7 +79,7 @@ class << File
|
|||
# false: not identical
|
||||
|
||||
def compare from, to, verbose = false
|
||||
$stderr.print from, " <=> ", to, "\n" if verbose
|
||||
$deferr.print from, " <=> ", to, "\n" if verbose
|
||||
|
||||
return false if stat(from).size != stat(to).size
|
||||
|
||||
|
|
@ -116,11 +116,11 @@ class << File
|
|||
def safe_unlink(*files)
|
||||
verbose = if files[-1].is_a? String then false else files.pop end
|
||||
begin
|
||||
$stderr.print files.join(" "), "\n" if verbose
|
||||
$deferr.print files.join(" "), "\n" if verbose
|
||||
chmod 0777, *files
|
||||
unlink(*files)
|
||||
rescue
|
||||
# STDERR.print "warning: Couldn't unlink #{files.join ' '}\n"
|
||||
# $deferr.print "warning: Couldn't unlink #{files.join ' '}\n"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ class << File
|
|||
next if FileTest.directory? dir
|
||||
parent = dirname(dir)
|
||||
makedirs parent unless FileTest.directory? parent
|
||||
$stderr.print "mkdir ", dir, "\n" if verbose
|
||||
$deferr.print "mkdir ", dir, "\n" if verbose
|
||||
if basename(dir) != ""
|
||||
Dir.mkdir dir, mode
|
||||
end
|
||||
|
|
@ -148,7 +148,7 @@ class << File
|
|||
vsave, $VERBOSE = $VERBOSE, false
|
||||
def chmod(mode, *files)
|
||||
verbose = if files[-1].is_a? String then false else files.pop end
|
||||
$stderr.printf "chmod %04o %s\n", mode, files.join(" ") if verbose
|
||||
$deferr.printf "chmod %04o %s\n", mode, files.join(" ") if verbose
|
||||
o_chmod mode, *files
|
||||
end
|
||||
$VERBOSE = vsave
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue