Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple Rake task to use sed to strip trailing whitespace from Ruby source
desc "Remove trailing whitespace for source files"
task :strip_whitespace do
files = %w[ .autotest .rspec .rvmrc Gemfile ]
globs = %w[ lib/**/*.rb spec/**/*.rb ]
files_from_globs = globs.map { |glob| Dir[glob] }
files_to_strip = (files + files_from_globs).flatten
system "sed -e 's/[ \t]*$//' -i '' #{files_to_strip.join(" ")}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.