[#262] Add a rake task to convert line endings to UNIX

This commit is contained in:
Eric Davis 2011-05-29 11:59:57 -07:00
parent bc249871a6
commit 05a4c4616f
1 changed files with 14 additions and 0 deletions

14
lib/tasks/code.rake Normal file
View File

@ -0,0 +1,14 @@
namespace :code do
desc "Fix line endings of all source files"
task :fix_line_endings do
unless `which fromdos`.present?
raise "fromdos command not found"
end
Dir['**/**{.rb,.html.erb,.rhtml,.rjs,.rsb,.plain.erb,.rxml,.yml,.rake,.eml}'].each do |file_name|
next if file_name.include?("vendor")
system("fromdos #{file_name}")
end
end
end