Sha256: 19a4a6b2335281374b4d2d35d8b465c1c6db81ad4c526e4a0681e30e84c7ba9f

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 KB

Contents

require 'rubygems'
require 'rake/gempackagetask'
require 'rake/testtask'
require 'rake/rdoctask'
 
task :default => :test

desc "Run All Tests"
Rake::TestTask.new :test do |test|
  test.test_files = ["test/**/*.rb"]
  test.verbose = true
end

desc %{Update ".manifest" with the latest list of project filenames. Respect\
.gitignore by excluding everything that git ignores. Update `files` and\
`test_files` arrays in "*.gemspec" file if it's present.}
task :manifest do
  list = Dir['**/*'].sort
  spec_file = Dir['*.gemspec'].first
  list -= [spec_file] if spec_file
 
  if File.exist?('.gitignore')
    File.read('.gitignore').each_line do |glob|
      glob = glob.chomp.sub(/^\//, '')
      list -= Dir[glob]
      list -= Dir["#{glob}/**/*"] if File.directory?(glob) and !File.symlink?(glob)
      puts "excluding #{glob}"
    end
  end
 
  if spec_file
    spec = File.read spec_file
    spec.gsub! /^(\s* s.(test_)?files \s* = \s* )( \[ [^\]]* \] | %w\( [^)]* \) )/mx do
      assignment = $1
      bunch = $2 ? list.grep(/^test\//) : list
      '%s%%w(%s)' % [assignment, bunch.join(' ')]
    end
 
    File.open(spec_file, 'w') {|f| f << spec }
  end
  File.open('manifest.txt', 'w') {|f| f << list.join("\n") }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
myronmarston-test_benchmarker-0.9.1 Rakefile
myronmarston-test_benchmarker-0.9.2 Rakefile
myronmarston-test_benchmarker-1.0.0 Rakefile
myronmarston-test_benchmarker-1.0.1 Rakefile