1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/mkmf.rb (rm_f, rm_rf): FileUtils.rm can take an array.

[ruby-dev:39345]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-09-17 21:36:53 +00:00
parent 9312426c1e
commit 80464f8f2a
2 changed files with 8 additions and 5 deletions

View file

@ -1,4 +1,7 @@
Fri Sep 18 06:34:21 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
Fri Sep 18 06:36:51 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (rm_f, rm_rf): FileUtils.rm can take an array.
[ruby-dev:39345]
* lib/mkmf.rb (create_header): open in binmode.

View file

@ -195,13 +195,13 @@ class Array
end
def rm_f(*files)
opt = ([files.pop] if Hash === files.last)
FileUtils.rm_f(Dir[*files], *opt)
opt = (Hash === files.last ? [files.pop] : [])
FileUtils.rm_f(Dir[*files.flatten], *opt)
end
def rm_rf(*files)
opt = ([files.pop] if Hash === files.last)
FileUtils.rm_rf(Dir[*files], *opt)
opt = (Hash === files.last ? [files.pop] : [])
FileUtils.rm_rf(Dir[*files.flatten], *opt)
end
# Returns time stamp of the +target+ file if it exists and is newer