~ubuntu-branches/ubuntu/trusty/cucumber/trusty

« back to all changes in this revision

Viewing changes to gem_tasks/fix_cr_lf.rake

  • Committer: Bazaar Package Importer
  • Author(s): Antonio Terceiro
  • Date: 2011-08-14 13:49:11 UTC
  • Revision ID: james.westby@ubuntu.com-20110814134911-9eepde13gulymmfy
Tags: upstream-1.0.2
ImportĀ upstreamĀ versionĀ 1.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
desc 'Make all files use UNIX (\n) line endings'
 
2
task :fix_cr_lf do
 
3
  files = FileList['**/*']
 
4
  files.each do |f|
 
5
    next if File.directory?(f) || f =~ /dos/
 
6
    s = IO.read(f)
 
7
    s.gsub!(/\r?\n/, "\n")
 
8
    File.open(f, "w") { |io| io.write(s) }
 
9
  end
 
10
end
 
 
b'\\ No newline at end of file'