Skip to content

Instantly share code, notes, and snippets.

@TwP
Created April 7, 2009 15:37
Show Gist options
  • Save TwP/91293 to your computer and use it in GitHub Desktop.
Save TwP/91293 to your computer and use it in GitHub Desktop.
desc "Strip trailing whitespace from .rb .txt .rake and .yml files"
task :strip do
cmd = 'find . '
cmd << %w[rb txt rake yml].map {|str| "-name '*.#{str}'"}.join(' -o ')
cmd << %q{ | xargs sed -i 's/\s\+$//g'}
sh cmd
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment