Added the framework for release. I haven't actually verified this yet for Net::LDAP, but I used the same framework for the recent release of MIME::Types. Some pieces of the code may need to be moved around to better handle the testing framework in the Rakefile and the pre-setup.rb file. To make this work, you will need the meta_project, gmailer, and archive-tar-minitar gems.
This commit is contained in:
parent
65102e44d9
commit
2faf22a2af
11 changed files with 2025 additions and 278 deletions
46
pre-setup.rb
Normal file
46
pre-setup.rb
Normal file
|
@ -0,0 +1,46 @@
|
|||
require 'rdoc/rdoc'
|
||||
##
|
||||
# Build the rdoc documentation. Also, try to build the RI documentation.
|
||||
#
|
||||
def build_rdoc(options)
|
||||
RDoc::RDoc.new.document(options)
|
||||
rescue RDoc::RDocError => e
|
||||
$stderr.puts e.message
|
||||
rescue Exception => e
|
||||
$stderr.puts "Couldn't build RDoc documentation\n#{e.message}"
|
||||
end
|
||||
|
||||
def build_ri(files)
|
||||
RDoc::RDoc.new(["--ri-site", "--merge"] + files)
|
||||
rescue RDoc::RDocError => e
|
||||
$stderr.puts e.message
|
||||
rescue Exception => e
|
||||
$stderr.puts "Couldn't build Ri documentation\n#{e.message}"
|
||||
end
|
||||
|
||||
def run_tests(test_list)
|
||||
return if test_list.empty?
|
||||
|
||||
require 'test/unit/ui/console/testrunner'
|
||||
$:.unshift "lib"
|
||||
test_list.each do |test|
|
||||
next if File.directory?(test)
|
||||
require test
|
||||
end
|
||||
|
||||
tests = []
|
||||
ObjectSpace.each_object { |o| tests << o if o.kind_of?(Class) }
|
||||
tests.delete_if { |o| !o.ancestors.include?(Test::Unit::TestCase) }
|
||||
tests.delete_if { |o| o == Test::Unit::TestCase }
|
||||
|
||||
tests.each { |test| Test::Unit::UI::Console::TestRunner.run(test) }
|
||||
$:.shift
|
||||
end
|
||||
|
||||
rdoc = %w(--main README --line-numbers
|
||||
--title MIME::Types)
|
||||
ri = %w(--ri-site --merge)
|
||||
dox = %w(README ChangeLog lib)
|
||||
build_rdoc rdoc + dox
|
||||
build_ri ri + dox
|
||||
run_tests Dir["tests/**/*"]
|
Loading…
Add table
Add a link
Reference in a new issue