Rakefile in rake-0.8.1 vs Rakefile in rake-0.8.2

- old
+ new

@@ -14,19 +14,22 @@ end require 'rake/clean' require 'rake/testtask' require 'rake/rdoctask' -CLEAN.include('**/*.o', '*.dot') +CLEAN.include('**/*.o', '*.dot', '**/.*.rbc') CLOBBER.include('doc/example/main', 'testdata') CLOBBER.include('test/data/**/temp_*') CLOBBER.include('test/data/chains/play.*') CLOBBER.include('test/data/file_creation_task/build') CLOBBER.include('test/data/file_creation_task/src') CLOBBER.include('TAGS') CLOBBER.include('coverage', 'rcov_aggregate') +# Prevent OS X from including extended attribute junk in the tar output +ENV['COPY_EXTENDED_ATTRIBUTES_DISABLE'] = 'true' + def announce(msg='') STDERR.puts msg end # Determine the current version of the software @@ -90,13 +93,17 @@ begin require 'rcov/rcovtask' Rcov::RcovTask.new do |t| t.libs << "test" + dot_rakes = t.rcov_opts = [ - '-xRakefile', '-xrakefile', '-xpublish.rf', '--text-report', - ] + '-xRakefile', '-xrakefile', '-xpublish.rf', + '-xlib/rake/contrib', '-x/Library', + '--text-report', + '--sort coverage' + ] + FileList['rakelib/*.rake'].pathmap("-x%p") t.test_files = FileList[ 'test/test*.rb', 'test/functional.rb' ] t.output_dir = 'coverage' t.verbose = true @@ -146,19 +153,20 @@ 'lib/**/*.rb', 'test/**/*.rb', 'test/**/*.rf', 'test/**/*.mf', 'test/**/Rakefile', + 'test/**/subdir', 'doc/**/*' ] PKG_FILES.exclude('doc/example/*.o') PKG_FILES.exclude(%r{doc/example/main$}) if ! defined?(Gem) puts "Package Target requires RubyGEMs" else - spec = Gem::Specification.new do |s| + SPEC = Gem::Specification.new do |s| #### Basic information. s.name = 'rake' s.version = $package_version @@ -205,13 +213,21 @@ # s.signing_key = File.join(ENV['CERT_DIR'], 'gem-private_key.pem') # s.cert_chain = [File.join(ENV['CERT_DIR'], 'gem-public_cert.pem')] # end end - package_task = Rake::GemPackageTask.new(spec) do |pkg| + package_task = Rake::GemPackageTask.new(SPEC) do |pkg| pkg.need_zip = true pkg.need_tar = true end + + file "rake.gemspec" => ["Rakefile", "lib/rake.rb"] do |t| + require 'yaml' + open(t.name, "w") { |f| f.puts SPEC.to_yaml } + end + + desc "Create a stand-alone gemspec" + task :gemspec => "rake.gemspec" end # Misc tasks ========================================================= def count_lines(filename)