Permalink
Browse files

Hoe'd the rakefile

[git-p4: depot-paths = "//src/ZenTest/dev/": change = 2700]
  • Loading branch information...
1 parent ff4e445 commit 266b9d2535df60788968fbad61998b9e3c04e54c @zenspider zenspider committed Oct 12, 2006
Showing with 10 additions and 111 deletions.
  1. +10 −111 Rakefile
View
@@ -1,134 +1,33 @@
# -*- ruby -*-
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'rake/gempackagetask'
-require 'rake/contrib/sshpublisher'
-require 'rbconfig'
+ENV["RUBY_FLAGS"]="-Ilib:bin:test" # FIX
+require 'rubygems'
+require 'hoe'
require './lib/zentest.rb'
-$VERBOSE = nil
-
-spec = Gem::Specification.new do |s|
- s.name = 'ZenTest'
- s.version = ZenTest::VERSION
- s.authors = ['Ryan Davis', 'Eric Hodel']
- s.email = 'ryand-ruby@zenspider.com'
-
- s.files = IO.readlines("Manifest.txt").map {|f| f.chomp }
- s.require_path = 'lib'
-
- s.executables = s.files.grep(/^bin/) { |f| File.basename f }
-
+Hoe.new("ZenTest", ZenTest::VERSION) do |p|
paragraphs = File.read("README.txt").split(/\n\n+/)
- s.instance_variable_set "@description", paragraphs[3..10].join("\n\n")
- s.instance_variable_set "@summary", paragraphs[12]
- s.homepage = "http://www.zenspider.com/ZSS/Products/ZenTest/"
- s.rubyforge_project = "zentest"
- s.has_rdoc = true
+ p.author = ['Ryan Davis', 'Eric Hodel']
- if $DEBUG then
- puts "#{s.name} #{s.version}"
- puts
- puts s.executables.sort.inspect
- puts
- puts "** summary:"
- puts s.summary
- puts
- puts "** description:"
- puts s.description
- end
-end
+ changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
+ summary, *description = p.paragraphs_of("README.txt", 3, 3..8)
-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|
- t.libs << 'test'
- t.verbose = true
+ p.changes = changes
+ p.summary = summary
+ p.description = description.join("\n\n")
end
desc 'Update Manifest.txt'
task :update_manifest => :clean do
sh "p4 open Manifest.txt; find . -type f | sed -e 's%./%%' | sort > Manifest.txt"
end
-desc 'Generate RDoc'
-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'
-end
-
-desc 'Upload RDoc to RubyForge'
-task :upload => :rdoc do
- config = YAML.load(File.read(File.expand_path("~/.rubyforge/config.yml")))
- user = "#{config["username"]}@rubyforge.org"
- project = '/var/www/gforge-projects/zentest'
- local_dir = 'doc'
- pub = Rake::SshDirPublisher.new user, project, local_dir
- pub.upload
-end
-
-$prefix = ENV['PREFIX'] || Config::CONFIG['prefix']
-$bin = File.join($prefix, 'bin')
-$lib = Config::CONFIG['sitelibdir']
-$bins = spec.executables
-$libs = spec.files.grep(/^lib\//).map { |f| f.sub(/^lib\//, '') }.sort
-
task :autotest do
ruby "-Ilib ./bin/autotest"
end
-task :install do
- $bins.each do |f|
- install File.join("bin", f), $bin, :mode => 0555
- end
-
- $libs.each do |f|
- 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
- $bins << "ZenTest"
- $libs << "ZenTest.rb"
-
- $bins.each do |f|
- rm_f File.join($bin, f)
- 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_docs, :clobber_package ] do
- rm_f Dir["**/*~"]
-end
-
-task :help do
- Rake.application.options.show_task_pattern = //
- Rake.application.display_tasks_and_comments
-end
-
task :sort do
begin
sh 'for f in lib/*.rb; do echo $f; grep "^ *def " $f | grep -v sort=skip > x; sort x > y; echo $f; echo; diff x y; done'

0 comments on commit 266b9d2

Please sign in to comment.