Sha256: 72c943c28d52cf662b1c3af2fe931587e28fb545451779c2dd7b538449826440

Contents?: true

Size: 491 Bytes

Versions: 14

Compression:

Stored size: 491 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

14 entries across 14 versions & 2 rubygems

Version Path
ta_by_star-4.1.0 cleaner.rb
ta_by_star-4.0.0 cleaner.rb
by_star-4.0.0 cleaner.rb
by_star-3.0.0 cleaner.rb
by_star-2.1.0.beta2 cleaner.rb
by_star-2.0.0.beta1 cleaner.rb
by_star-1.0.1 cleaner.rb
by_star-1.0.0 cleaner.rb
by_star-0.9.0 cleaner.rb
by_star-0.8.0 cleaner.rb
by_star-0.7.2 cleaner.rb
by_star-0.7.1 cleaner.rb
by_star-0.7.0 cleaner.rb
by_star-0.6.4 cleaner.rb