summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-17 21:36:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-17 21:36:53 +0000
commit80464f8f2ad91003c05a3ea84e2c1ab824ec2662 (patch)
tree7ea05881848eec78623356425e668342bf454946
parent9312426c1ea240c4a2e938976d3f4c8f2f155e6a (diff)
* 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
-rw-r--r--ChangeLog5
-rw-r--r--lib/mkmf.rb8
2 files changed, 8 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index ce512b4d321..fbe80dbc8a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index c83b54a1a45..815672b0538 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -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