Sha256: a88734351d0095cb1a652c0d9cc9f646d91cb1f718271ad29841435c1129272e
Contents?: true
Size: 1.33 KB
Versions: 1
Compression:
Stored size: 1.33 KB
Contents
require 'bundler/gem_tasks' require 'rake/testtask' Rake::TestTask.new do |t| t.libs << 'test' t.pattern = 'test/**/*_test.rb' end task :default => :test namespace :whitespace do FIND_FILE_BLACKLIST = "find . -type f | grep -v -e '.git/'" desc 'Runs all whitespace tasks' task :all do Rake::Task["whitespace:remove_trailing"].invoke Rake::Task["whitespace:covert_to_soft_tabs"].invoke Rake::Task["whitespace:remove_blank_lines"].invoke end desc 'Removes trailing whitespace' task :remove_trailing do system %{ echo Removing trailing whitespace for f in `#{FIND_FILE_BLACKLIST}`; do cat $f | sed 's/[ \t]*$//' > .whitespace; cp .whitespace $f; rm .whitespace; echo $f; done } end desc 'Converts hard-tabs into two-space soft-tabs' task :covert_to_soft_tabs do system %{ echo Converting hard-tabs into two-space soft-tabs for f in `#{FIND_FILE_BLACKLIST}`; do cat $f | sed 's/\t/ /g' > .soft_tabs; cp .soft_tabs $f; rm .soft_tabs; echo $f; done } end desc 'Remove consecutive blank lines' task :remove_blank_lines do system %{ echo Removing consecutive blank lines for f in `#{FIND_FILE_BLACKLIST}`; do cat $f | sed '/./,/^$/!d' > .blank_lines; cp .blank_lines $f; rm .blank_lines; echo $f; done } end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
amazon-mws-plus-0.1.3 | Rakefile |