require "rubygems/package_task"
require "rake/testtask"

gemspec = Gem::Specification.new do |s|
  # basic
  s.name     = "gem-compiler"
  s.version  = "0.1.1"
  s.platform = Gem::Platform::RUBY

  # description
  s.summary     = "A RubyGems plugin that generates binary gems."
  s.description = <<-EOF
A RubyGems plugin that helps generates binary gems from already existing
ones without altering the original source code. It compiles Ruby C
extensions and bundles the result into a new gem.
EOF

  # project info
  s.homepage = "https://github.com/luislavena/gem-compiler"
  s.licenses = ["MIT"]
  s.author   = "Luis Lavena"
  s.email    = "luislavena@gmail.com"

  # requirements
  s.required_ruby_version     = ">= 1.8.7"
  s.required_rubygems_version = ">= 1.8.24"

  # boring part
  s.files = FileList["README.md", "History.md", "rakefile.rb", "lib/**/*.rb"]
end

Gem::PackageTask.new(gemspec) do |pkg|
end

Rake::TestTask.new do |t|
  t.pattern = "test/**/test*.rb"
  t.verbose = true
end

require "rubygems/package_task"

gemspec = Gem::Specification.new do |s|
  # basic
  s.name     = "gem-compiler"
  s.version  = "0.1.1"
  s.platform = Gem::Platform::RUBY

  # description
  s.summary     = "A RubyGems plugin that generates binary gems."
  s.description = <<-EOF
A RubyGems plugin that helps generates binary gems from already existing
ones without altering the original source code. It compiles Ruby C
extensions and bundles the result into a new gem.
EOF

  # project info
  s.homepage = "https://github.com/luislavena/gem-compiler"
  s.licenses = ["MIT"]
  s.author   = "Luis Lavena"
  s.email    = "luislavena@gmail.com"

  # requirements
  s.required_ruby_version     = ">= 1.8.7"
  s.required_rubygems_version = ">= 1.8.24"

  # boring part
  s.files = FileList["README.md", "History.md", "rakefile.rb", "lib/**/*.rb"]
end

Gem::PackageTask.new(gemspec) do |pkg|
end

desc "Run tests"
task :test do
  lib_dirs = ["lib", "test"].join(File::PATH_SEPARATOR)
  test_files = FileList["test/**/test*.rb"].gsub("test/", "")

  ruby "-I#{lib_dirs} -e \"ARGV.each { |f| require f }\" #{test_files}"
end

task :default => [:test]

Replace broken Rake TestTask with custom one
Replace broken Rake TestTask with custom one

Rake::TestTask always add it's lib directory to $LOAD_PATH, making
impossible, even using `gem` to load updated versions of any gem that is
not bundled with Ruby.

This custom version support both 1.8.x and 1.9.3 and works properly with
latest MiniTest.

To help testing Rake's default task now depends on test execution.
