Rakefile in ZenTest-3.1.0 vs Rakefile in ZenTest-3.2.0
- old
+ new
@@ -14,31 +14,41 @@
s.name = 'ZenTest'
s.version = ZenTest::VERSION
s.authors = ['Ryan Davis', 'Eric Hodel']
s.email = 'ryand-ruby@zenspider.com'
- s.files = File.read('Manifest.txt').split($/)
+ s.files = IO.readlines("Manifest.txt").map {|f| f.chomp }
s.require_path = 'lib'
- s.executables = %w[ZenTest unit_diff autotest multiruby]
+ s.executables = s.files.grep(/^bin\//).map { |f| File.basename f }
+
paragraphs = File.read("README.txt").split(/\n\n+/)
- s.instance_variable_set "@description", paragraphs[3..9].join("\n\n")
- s.instance_variable_set "@summary", paragraphs[11]
+ s.instance_variable_set "@description", paragraphs[3..10].join("\n\n")
+ s.instance_variable_set "@summary", paragraphs[12]
if $DEBUG then
puts "ZenTest #{s.version}"
puts
+ puts s.executables.sort.inspect
+ puts
+ puts "** summary:"
puts s.summary
puts
+ puts "** description:"
puts s.description
end
- s.files = IO.readlines("Manifest.txt").map {|f| f.chomp }
s.homepage = "http://www.zenspider.com/ZSS/Products/ZenTest/"
s.rubyforge_project = "zentest"
+ s.has_rdoc = true
end
+desc 'Build Gem'
+Rake::GemPackageTask.new spec do |pkg|
+ pkg.need_tar = true
+end
+
desc 'Run tests'
task :default => :test
desc 'Run tests'
Rake::TestTask.new :test do |t|
@@ -55,31 +65,33 @@
Rake::RDocTask.new :rdoc do |rd|
rd.rdoc_dir = 'doc'
rd.rdoc_files.add 'lib', 'README.txt', 'History.txt', 'LinuxJournalArticle.txt'
rd.main = 'README.txt'
rd.options << '-d' if `which dot` =~ /\/dot/ unless RUBY_PLATFORM =~ /win32/
- rd.options << '-t "ZenTest RDoc"'
+ rd.options << '-t ZenTest RDoc'
end
-desc 'Build Gem'
-Rake::GemPackageTask.new spec do |pkg|
- pkg.need_tar = true
-end
-
$prefix = ENV['PREFIX'] || Config::CONFIG['prefix']
$bin = File.join($prefix, 'bin')
$lib = Config::CONFIG['sitelibdir']
-$bins = %w(zentest autotest unit_diff multiruby)
-$libs = %w(zentest.rb autotest.rb rails_autotest.rb unit_diff.rb)
+$bins = spec.executables
+$libs = spec.files.grep(/^lib\//).map { |f| f.sub(/^lib\//, '') }.sort
+task :blah do
+ p $bins
+ p $libs
+end
+
task :install do
$bins.each do |f|
install File.join("bin", f), $bin, :mode => 0555
end
$libs.each do |f|
- install File.join("lib", f), $lib, :mode => 0444
+ dir = File.join($lib, File.dirname(f))
+ mkdir_p dir unless test ?d, dir
+ install File.join("lib", f), dir, :mode => 0444
end
end
task :uninstall do
# add old versions
@@ -91,11 +103,16 @@
end
$libs.each do |f|
rm_f File.join($lib, f)
end
+
+ rm_rf File.join($lib, "test")
end
desc 'Clean up'
task :clean => [ :clobber_rdoc, :clobber_package ] do
rm_f Dir["**/*~"]
end
+
+# vim:syntax=ruby
+