Rakefile in ripple-1.0.0.beta vs Rakefile in ripple-1.0.0.beta2

- old
+ new

@@ -22,9 +22,28 @@ desc %{Release the gem to RubyGems.org} task :release => :gem do system "gem push pkg/#{gemspec.name}-#{gemspec.version}.gem" end +desc "Cleans up white space in source files" +task :clean_whitespace do + no_file_cleaned = true + + Dir["**/*.rb"].each do |file| + contents = File.read(file) + cleaned_contents = contents.gsub(/([ \t]+)$/, '') + unless cleaned_contents == contents + no_file_cleaned = false + puts " - Cleaned #{file}" + File.open(file, 'w') { |f| f.write(cleaned_contents) } + end + end + + if no_file_cleaned + puts "No files with trailing whitespace found" + end +end + desc "Run Unit Specs Only" RSpec::Core::RakeTask.new(:spec) do |spec| spec.rspec_opts = %w[--profile --tag ~integration] end