summaryrefslogtreecommitdiff
path: root/lib/rake/contrib
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-15 21:59:37 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-15 21:59:37 +0000
commit9c66bad9f3d522d50d4a45ef8a3a92abbf93229f (patch)
tree8fc1ae219e41bdd711442b1d35149da4f45dfa8a /lib/rake/contrib
parentbfc95c6e1639edc909338ef4d20d990caf6f630e (diff)
* lib/rake*: Updated to rake 0.9.3
* test/rake*: ditto * bin/rake: ditto * NEWS: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rake/contrib')
-rw-r--r--lib/rake/contrib/ftptools.rb3
-rw-r--r--lib/rake/contrib/sys.rb12
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/rake/contrib/ftptools.rb b/lib/rake/contrib/ftptools.rb
index 78420c7..eaf8885 100644
--- a/lib/rake/contrib/ftptools.rb
+++ b/lib/rake/contrib/ftptools.rb
@@ -127,7 +127,8 @@ module Rake # :nodoc:
# Upload all files matching +wildcard+ to the uploader's root
# path.
def upload_files(wildcard)
- Dir[wildcard].each do |fn|
+ fail "OUCH"
+ Rake.glob(wildcard).each do |fn|
upload(fn)
end
end
diff --git a/lib/rake/contrib/sys.rb b/lib/rake/contrib/sys.rb
index 41963f1..aefd4a1 100644
--- a/lib/rake/contrib/sys.rb
+++ b/lib/rake/contrib/sys.rb
@@ -27,7 +27,7 @@ module Sys
# Install all the files matching +wildcard+ into the +dest_dir+
# directory. The permission mode is set to +mode+.
def install(wildcard, dest_dir, mode)
- Dir[wildcard].each do |fn|
+ Rake.glob(wildcard).each do |fn|
File.install(fn, dest_dir, mode, $verbose)
end
end
@@ -81,7 +81,7 @@ module Sys
# recursively delete directories.
def delete(*wildcards)
wildcards.each do |wildcard|
- Dir[wildcard].each do |fn|
+ Rake.glob(wildcard).each do |fn|
if File.directory?(fn)
log "Deleting directory #{fn}"
Dir.delete(fn)
@@ -96,10 +96,10 @@ module Sys
# Recursively delete all files and directories matching +wildcard+.
def delete_all(*wildcards)
wildcards.each do |wildcard|
- Dir[wildcard].each do |fn|
+ Rake.glob(wildcard).each do |fn|
next if ! File.exist?(fn)
if File.directory?(fn)
- Dir["#{fn}/*"].each do |subfn|
+ Rake.glob("#{fn}/*").each do |subfn|
next if subfn=='.' || subfn=='..'
delete_all(subfn)
end
@@ -161,7 +161,7 @@ module Sys
# Perform a block with each file matching a set of wildcards.
def for_files(*wildcards)
wildcards.each do |wildcard|
- Dir[wildcard].each do |fn|
+ Rake.glob(wildcard).each do |fn|
yield(fn)
end
end
@@ -172,7 +172,7 @@ module Sys
private # ----------------------------------------------------------
def for_matching_files(wildcard, dest_dir)
- Dir[wildcard].each do |fn|
+ Rake.glob(wildcard).each do |fn|
dest_file = File.join(dest_dir, fn)
parent = File.dirname(dest_file)
makedirs(parent) if ! File.directory?(parent)