[asl-commit] ActiveSambaLdap r17:

kou at cozmixng.org kou at cozmixng.org
Fri Aug 3 22:31:53 EDT 2007


retro	2007-08-04 11:31:52 +0900 (Sat, 04 Aug 2007)

  New Revision: 17

  Modified files:
    trunk/Rakefile

  Log:


  Modified: trunk/Rakefile (+30 -3)
===================================================================
--- trunk/Rakefile	2006-11-14 00:34:03 -15:00 (rev 16)
+++ trunk/Rakefile	2007-08-04 11:31:52 +09:00 (rev 17)
@@ -1,6 +1,7 @@
 # -*- ruby -*-
 
 require 'find'
+require 'fileutils'
 
 base_dir = File.expand_path(File.dirname(__FILE__))
 truncate_base_dir = Proc.new do |x|
@@ -12,9 +13,14 @@
 eval('require_gem_if_need.call("hoe")', _binding)
 
 manifest = File.join(base_dir, "Manifest.txt")
-manifest_contents = %w(README Rakefile)
-Find.find(File.join(base_dir, "lib")) do |target|
+manifest_contents = []
+excluded_components = %w(.svn .test-result .config Manifest.txt config.yml doc)
+excluded_suffixes = %w(.help)
+Find.find(base_dir) do |target|
   target = truncate_base_dir[target]
+  components = target.split(File::SEPARATOR)
+  Find.prune if (excluded_components - components) != excluded_components
+  next if excluded_suffixes.include?(File.extname(target))
   manifest_contents << target if File.file?(target)
 end
 
@@ -26,13 +32,14 @@
   entry.gsub(/(\A\n+|\n+\z)/, '') + "\n"
 end
 
-Hoe.new("AactiveSambaLdap", ActiveSambaLdap::VERSION) do |p|
+project = Hoe.new("AactiveSambaLdap", ActiveSambaLdap::VERSION) do |p|
   p.rubyforge_name = "asl"
   p.summary = "Samba+LDAP administration tools"
   p.extra_deps << ["activeldap", ">= 0.8.0"]
   p.email = "kou at cozmixng.org"
   p.author = "Kouhei Sutou"
   p.url = "http://asl.rubyforge.org/"
+  p.rdoc_pattern = /^(lib|bin)|txt$|\.(en|ja)$/
 
   news_of_current_release = File.read("NEWS.en").split(/^==\s.*$/)[1]
   p.changes = cleanup_white_space(news_of_current_release)
@@ -41,3 +48,23 @@
   whats_this = cleanup_white_space(entries[entries.index("What\'s this?") + 1])
   p.summary, p.description, = whats_this.split(/\n\n+/, 3)
 end
+
+rdoc_task = nil
+if ObjectSpace.each_object(Rake::RDocTask) {|rdoc_task|} != 1
+  puts "hoe may be changed"
+end
+rdoc_task.main = "README.en"
+rdoc_task.options << "--charset=UTF-8"
+rdoc_task.template = "kilmer"
+rdoc_task.rdoc_files -= project.bin_files
+rdoc_task.rdoc_files += project.bin_files.collect {|x| "#{x}.help"}
+
+project.bin_files.each do |bin|
+  bin_help = "#{bin}.help"
+  File.open(bin_help, "w") do |f|
+    f.puts(`#{RUBY} -I #{File.join(base_dir, 'lib')} #{bin} --help`)
+  end
+  at_exit do
+    FileUtils.rm_f(bin_help)
+  end
+end



More information about the asl-commit mailing list