Permalink
Browse files

allow other extensions except web files for data output

  • Loading branch information...
1 parent 9fb9020 commit 78a575eeceae820b038f6827e38e8fcfa12c3d0c @rdulepet committed Jun 2, 2010
Showing with 5 additions and 18 deletions.
  1. +5 −18 job.rb
View
23 job.rb
@@ -202,14 +202,7 @@ def store_results_and_logs
# .html,.htm,.css,.png,.pdf,.jpg
# iterate through directory and store files one at a time in S3
upload_files = Dir[File.join("#{Global.results_dir}/#{@curr_uuid}", "*")].select{|file| File.ftype(file) == "file" &&
- (File.extname(file) == '.jpg' ||
- File.extname(file) == '.png' ||
- File.extname(file) == '.gif' ||
- File.extname(file) == '.html' ||
- File.extname(file) == '.htm' ||
- File.extname(file) == '.js' ||
- File.extname(file) == '.css' ||
- File.extname(file) == '.pdf')}.each{|name|
+ /\.(jpg|png|gif|html|htm|js|css|pdf)$/.match(file)}.each{|name|
name = name.split("/").last
puts "RESULTS_FILE = #{Global.results_dir}/#{@curr_uuid}/#{name}"
upload_results_to_s3(@server_node,
@@ -226,16 +219,10 @@ def store_data
# upload only web content files for results
# .html,.htm,.css,.png,.pdf,.jpg
# iterate through directory and store files one at a time in S3
- upload_files = Dir[File.join("#{Global.results_dir}/#{@curr_uuid}", "*")].select{|file| File.ftype(file) == "file" &&
- (File.extname(file) != '.jpg' &&
- File.extname(file) != '.png' &&
- File.extname(file) != '.gif' &&
- File.extname(file) != '.html' &&
- File.extname(file) != '.htm' &&
- File.extname(file) != '.js' &&
- File.extname(file) != '.css' &&
- File.extname(file) != '.pdf' &&
- File.extname(file) != '.log')}.each{|name|
+ upload_files = Dir[File.join("#{Global.results_dir}/#{@curr_uuid}", "*")].select{|file|
+ puts "file in dir=#{file}"
+ File.ftype(file) == "file" &&
+ !/\.(jpg|png|gif|html|htm|js|css|pdf|log|r|rb|java|php|py|pyc|jar|gz|tar|zip|class|exe|so|o)$/.match(file)}.each{|name|
name = name.split("/").last
if ! @in_data_files.has_key?(name)
puts "DATA_OUTPUT_FILE = #{Global.results_dir}/#{@curr_uuid}/#{name}"

0 comments on commit 78a575e

Please sign in to comment.