summaryrefslogtreecommitdiff
path: root/lib/rake/contrib
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-15 22:32:34 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-15 22:32:34 +0000
commit1b023030a88a35118875b068a1fd725c58a32083 (patch)
tree07bbdc25e71d98bfa4091f617d82fc87541364c5 /lib/rake/contrib
parente9c28d0fce1fa34bd83e910273981190932ebf63 (diff)
* lib/rake*: Updated to rake 0.9.4
http://rake.rubyforge.org/doc/release_notes/rake-0_9_4_rdoc.html for a list of changes in 0.9.4. * test/rake*: ditto * NEWS: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rake/contrib')
-rw-r--r--lib/rake/contrib/ftptools.rb4
-rw-r--r--lib/rake/contrib/sys.rb13
2 files changed, 9 insertions, 8 deletions
diff --git a/lib/rake/contrib/ftptools.rb b/lib/rake/contrib/ftptools.rb
index eaf8885..d39cde8 100644
--- a/lib/rake/contrib/ftptools.rb
+++ b/lib/rake/contrib/ftptools.rb
@@ -5,6 +5,7 @@
require 'date'
require 'net/ftp'
+require 'rake/file_list'
module Rake # :nodoc:
@@ -127,8 +128,7 @@ module Rake # :nodoc:
# Upload all files matching +wildcard+ to the uploader's root
# path.
def upload_files(wildcard)
- fail "OUCH"
- Rake.glob(wildcard).each do |fn|
+ FileList.glob(wildcard).each do |fn|
upload(fn)
end
end
diff --git a/lib/rake/contrib/sys.rb b/lib/rake/contrib/sys.rb
index aefd4a1..5e31ea8 100644
--- a/lib/rake/contrib/sys.rb
+++ b/lib/rake/contrib/sys.rb
@@ -10,6 +10,7 @@ begin
rescue LoadError
end
require 'rbconfig'
+require 'rake/file_list'
######################################################################
# Sys provides a number of file manipulation tools for the convenience
@@ -27,7 +28,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)
- Rake.glob(wildcard).each do |fn|
+ FileList.glob(wildcard).each do |fn|
File.install(fn, dest_dir, mode, $verbose)
end
end
@@ -81,7 +82,7 @@ module Sys
# recursively delete directories.
def delete(*wildcards)
wildcards.each do |wildcard|
- Rake.glob(wildcard).each do |fn|
+ FileList.glob(wildcard).each do |fn|
if File.directory?(fn)
log "Deleting directory #{fn}"
Dir.delete(fn)
@@ -96,10 +97,10 @@ module Sys
# Recursively delete all files and directories matching +wildcard+.
def delete_all(*wildcards)
wildcards.each do |wildcard|
- Rake.glob(wildcard).each do |fn|
+ FileList.glob(wildcard).each do |fn|
next if ! File.exist?(fn)
if File.directory?(fn)
- Rake.glob("#{fn}/*").each do |subfn|
+ FileList.glob("#{fn}/*").each do |subfn|
next if subfn=='.' || subfn=='..'
delete_all(subfn)
end
@@ -161,7 +162,7 @@ module Sys
# Perform a block with each file matching a set of wildcards.
def for_files(*wildcards)
wildcards.each do |wildcard|
- Rake.glob(wildcard).each do |fn|
+ FileList.glob(wildcard).each do |fn|
yield(fn)
end
end
@@ -172,7 +173,7 @@ module Sys
private # ----------------------------------------------------------
def for_matching_files(wildcard, dest_dir)
- Rake.glob(wildcard).each do |fn|
+ FileList.glob(wildcard).each do |fn|
dest_file = File.join(dest_dir, fn)
parent = File.dirname(dest_file)
makedirs(parent) if ! File.directory?(parent)