From bfce9ed2ff2eef94584f8e9a84c510b8b4321464 Mon Sep 17 00:00:00 2001 From: Lorenzo Planas Date: Wed, 6 Nov 2013 16:01:00 +0100 Subject: [PATCH] Do not import readme-like txt files --- services/importer/lib/importer/unp.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/services/importer/lib/importer/unp.rb b/services/importer/lib/importer/unp.rb index f4024d56d9d9..4fa7478f084a 100644 --- a/services/importer/lib/importer/unp.rb +++ b/services/importer/lib/importer/unp.rb @@ -29,9 +29,7 @@ def initialize def run(path) return without_unpacking(path) unless compressed?(path) extract(path) - crawl(temporary_directory) - .select { |path| !(path =~ /.*readme.*\.txt/i) } - .each { |path| process(path) } + crawl(temporary_directory).each { |path| process(path) } @source_files = split(source_files) self rescue => exception @@ -59,6 +57,7 @@ def process(path) def crawl(path, files=[]) Dir.foreach(path) do |subpath| next if hidden?(subpath) + next if subpath =~ /.*readme.*\.txt/i fullpath = normalize("#{path}/#{subpath}") (crawl(fullpath, files) and next) if File.directory?(fullpath)