Sha256: 00175d467cb69afdb8c1a29395c93616ee37c0b32a2c5684ae6c0ca75de37816

Contents?: true

Size: 515 Bytes

Versions: 4

Compression:

Stored size: 515 Bytes

Contents

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
by_star-4.0.1 cleaner.rb
by_star-2.2.1 cleaner.rb
by_star-2.2.0 cleaner.rb
by_star-2.2.0.rc1 cleaner.rb