public
Description: Remote multi-server automation tool. This repository is no longer being actively maintained. Please ask on the mailing list to find someone who has a well-maintained fork. Thanks!
Homepage: http://www.capify.org
Clone URL: git://github.com/jamis/capistrano.git
Make deploy:upload use the upload() helper for more efficient directory 
processing.
Jamis Buck (author)
Thu Jun 05 17:40:44 -0700 2008
commit  919f868573c9e6a01d9e356fb5f222c5ed3600a7
tree    43450305d27ca58f1597203fb8a64950de47b59d
parent  7b417973a9c21634f79b4abf91572d9e35783e79
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *unreleased*
0
 
0
+* Make deploy:upload use the upload() helper for more efficient directory processing [Jamis Buck]
0
+
0
 * Make deploy:upload accept globs [Mark Imbriaco]
0
 
0
 * Make sure the host is reported with the output from scm_run [Jamis Buck]
...
233
234
235
236
237
 
238
239
 
 
 
 
240
241
242
243
244
245
246
 
 
247
248
249
250
251
252
253
 
254
255
256
...
233
234
235
 
 
236
237
238
239
240
241
242
243
244
 
 
 
 
 
245
246
247
 
 
 
 
 
 
248
249
250
251
0
@@ -233,24 +233,19 @@ namespace :deploy do
0
     To use this task, specify the files and directories you want to copy as a \
0
     comma-delimited list in the FILES environment variable. All directories \
0
     will be processed recursively, with all files being pushed to the \
0
-    deployment servers. Any file or directory starting with a '.' character \
0
-    will be ignored.
0
+    deployment servers.
0
 
0
       $ cap deploy:upload FILES=templates,controller.rb
0
+
0
+    Dir globs are also supported:
0
+
0
+      $ cap deploy:upload FILES='config/apache/*.conf'
0
   DESC
0
   task :upload, :except => { :no_release => true } do
0
-    files = (ENV["FILES"] || "").
0
-      split(",").
0
-      map { |f| f.strip!; Dir[ File.directory?(f) ? "#{f}/**/*" : f ]}.
0
-      flatten.
0
-      reject { |f| File.directory?(f) || File.basename(f)[0] == ?. }
0
+    files = (ENV["FILES"] || "").split(",").map { |f| Dir[f.strip] }.flatten
0
+    abort "Please specify at least one file or directory to update (via the FILES environment variable)" if files.empty?
0
 
0
-    abort "Please specify at least one file to update (via the FILES environment variable)" if files.empty?
0
-
0
-    files.each do |file|
0
-      content = File.open(file, "rb") { |f| f.read }
0
-      put content, File.join(current_path, file)
0
-    end
0
+    files.each { |file| top.upload(file, File.join(current_path, file)) }
0
   end
0
 
0
   desc <<-DESC

Comments