Rakefile in prawn-0.12.0 vs Rakefile in prawn-0.13.0

- old
+ new

@@ -1,39 +1,35 @@ -require "rubygems" require "bundler" Bundler.setup require 'rake' -require 'rake/testtask' -require "rake/rdoctask" -require "rake/gempackagetask" +require 'rspec/core/rake_task' +require 'rdoc/task' +require 'rubygems/package_task' -task :default => [:test] - -desc "Run all tests, test-spec, mocha, and pdf-reader required" -Rake::TestTask.new do |test| - # test.ruby_opts << "-w" # .should == true triggers a lot of warnings - test.libs << "spec" - test.test_files = Dir[ "spec/*_spec.rb" ] - test.verbose = true +task :default => [:spec] + +desc "Run all rspec files" +RSpec::Core::RakeTask.new("spec") do |c| + c.rspec_opts = "-t ~unresolved" end desc "Show library's code statistics" task :stats do - require 'code_statistics' - CodeStatistics::TEST_TYPES << "Specs" - CodeStatistics.new( ["Prawn", "lib"], - ["Specs", "spec"] ).to_s + require 'code_statistics' + CodeStatistics::TEST_TYPES << "Specs" + CodeStatistics.new( ["Prawn", "lib"], + ["Specs", "spec"] ).to_s end desc "genrates documentation" -Rake::RDocTask.new do |rdoc| - rdoc.rdoc_files.include( "README", +RDoc::Task.new do |rdoc| + rdoc.rdoc_files.include( "README.md", "COPYING", - "LICENSE", - "HACKING", "lib/" ) - rdoc.main = "README" + "LICENSE", + "lib/" ) + rdoc.main = "README.md" rdoc.rdoc_dir = "doc/html" rdoc.title = "Prawn Documentation" end desc "Generate the 'Prawn by Example' manual" @@ -43,9 +39,9 @@ %w[manual manual manual])) puts "The Prawn manual is available at manual.pdf. Happy Prawning!" end spec = Gem::Specification.load "prawn.gemspec" -Rake::GemPackageTask.new(spec) do |pkg| +Gem::PackageTask.new(spec) do |pkg| pkg.need_zip = true pkg.need_tar = true end