You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

fix_cr_lf.rake 516 B

2 years ago
12345678910111213141516171819202122
  1. # frozen_string_literal: true
  2. require 'pathname'
  3. desc 'Make all files use UNIX (\n) line endings'
  4. task :fix_cr_lf do
  5. iso_8859_1_files = FileList.new(
  6. 'features/docs/iso-8859-1.feature',
  7. 'features/lib/step_definitions/iso-8859-1_steps.rb'
  8. )
  9. utf8_files = FileList.new('**/*') do |fl|
  10. fl.exclude { |f| File.directory?(f) }
  11. end
  12. paths = (utf8_files - iso_8859_1_files).map { |f| Pathname(f) }
  13. paths.each do |path|
  14. content = path.read.gsub(/\r?\n/, "\n")
  15. path.write(content)
  16. end
  17. end

No Description

Contributors (1)