Rakefile in libxml-ruby-0.3.6 vs Rakefile in libxml-ruby-0.3.8

- old
+ new

@@ -69,18 +69,18 @@ task :tu => :unittests task :test => :unittests Rake::TestTask.new(:alltests) do |t| t.test_files = FileList[ - 'tests/tc_*.rb', + 'tests/runner.rb', 'tests/contrib/*.rb', ] t.verbose = true end Rake::TestTask.new(:unittests) do |t| - t.test_files = FileList['tests/tc_*.rb'] + t.test_files = FileList['tests/runner.rb'] t.verbose = false end #Rake::TestTask.new(:funtests) do |t| # t.test_files = FileList['test/fun*.rb'] @@ -96,11 +96,12 @@ rd = Rake::RDocTask.new(:doc) do |rdoc| rdoc.rdoc_dir = 'html' rdoc.title = "Libxml-Ruby API" rdoc.options << '--main' << 'README' rdoc.rdoc_files.include('README', 'LICENSE', 'TODO') - rdoc.rdoc_files.include('ext/xml/ruby_xml*.c', '*.rdoc') + rdoc.rdoc_files.include('ext/xml/ruby_xml*.c', 'ext/xml/*.rb') + rdoc.rdoc_files.include('*.rdoc') end desc "Publish the RDoc documentation to project web site" task :pubdoc => [ :doc ] do unless ENV['RUBYFORGE_ACCT'] @@ -117,22 +118,27 @@ # Packaging / Version number tasks ----------------------------------- # Used during release packaging if a REL is supplied task :update_version do unless PKG_VERSION == CURRENT_VERSION File.open('ext/xml/libxml.h.new','w+') do |f| + maj, min, mic = /(\d+)\.(\d+)(?:\.(\d+))?/.match(PKG_VERSION).captures f << File.read('ext/xml/libxml.h'). gsub(/RUBY_LIBXML_VERSION\s+"(\d.+)"/) { "RUBY_LIBXML_VERSION \"#{PKG_VERSION}\"" }. - gsub(/RUBY_LIBXML_VERNUM\s+\d+/) { "RUBY_LIBXML_VERNUM #{PKG_VERSION.tr('.','')}" } + gsub(/RUBY_LIBXML_VERNUM\s+\d+/) { "RUBY_LIBXML_VERNUM #{PKG_VERSION.tr('.','').sub(/^0*/,'')}" }. + gsub(/RUBY_LIBXML_VER_MAJ\s+\d+/) { "RUBY_LIBXML_VER_MAJ #{maj}" }. + gsub(/RUBY_LIBXML_VER_MIN\s+\d+/) { "RUBY_LIBXML_VER_MIN #{min}" }. + gsub(/RUBY_LIBXML_VER_MIC\s+\d+/) { "RUBY_LIBXML_VER_MIC #{mic || 0}" } end mv('ext/xml/libxml.h.new', 'ext/xml/libxml.h') end end PKG_FILES = FileList[ 'ext/xml/extconf.rb', '[A-Z]*', - 'ext/xml/*.c', + 'ext/xml/*.c', + 'ext/xml/*.inc', 'ext/xml/ruby_xml*.h', 'ext/xml/libxml.h', 'tests/**/*', ] @@ -159,14 +165,13 @@ #### Load-time details s.require_path = 'ext' #### Documentation and testing. s.has_rdoc = true - s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a + s.extra_rdoc_files = rd.rdoc_files.to_a s.rdoc_options << '--title' << 'Libxml-Ruby API' << - '--main' << 'README' << - '-o' << 'rdoc' + '--main' << 'README' s.test_files = Dir.glob('tests/*runner.rb') #### Author and project details.