cleaner.rb in by_star-2.2.1 vs cleaner.rb in by_star-3.0.0
- old
+ new
@@ -1,25 +1,25 @@
-files = Dir["**/*"]
-ignored_files = [
- /log\/.*/,
-]
-
-files.delete_if do |file|
- if File.directory?(file)
- true
- else
- ignored_files.any? do |condition|
- if condition.is_a?(String)
- file == condition
- else
- condition.match(file)
- end
- end || false
- end
-end
-
-for file in files - ignored_files
- if File.file?(file)
- lines = File.readlines(file).map { |line| line.gsub(/^\s+$/, "\n") }
- File.open(file, "w+") { |f| f.write(lines.join) }
- end
+files = Dir["**/*"]
+ignored_files = [
+ /log\/.*/,
+]
+
+files.delete_if do |file|
+ if File.directory?(file)
+ true
+ else
+ ignored_files.any? do |condition|
+ if condition.is_a?(String)
+ file == condition
+ else
+ condition.match(file)
+ end
+ end || false
+ end
+end
+
+for file in files - ignored_files
+ if File.file?(file)
+ lines = File.readlines(file).map { |line| line.gsub(/^\s+$/, "\n") }
+ File.open(file, "w+") { |f| f.write(lines.join) }
+ end
end
\ No newline at end of file