tasks/post_load.rake in logging-0.7.1 vs tasks/post_load.rake in logging-0.8.0
- old
+ new
@@ -1,30 +1,39 @@
-# $Id: post_load.rake 105 2008-02-26 04:43:21Z tim_pease $
+# $Id$
# This file does not define any rake tasks. It is used to load some project
# settings if they are not defined by the user.
-PROJ.rdoc_exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
-PROJ.exclude << "^#{Regexp.escape(PROJ.ann_file)}$"
+PROJ.rdoc.exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
+PROJ.exclude << ["^#{Regexp.escape(PROJ.ann.file)}$",
+ "^#{Regexp.escape(PROJ.rdoc.dir)}/",
+ "^#{Regexp.escape(PROJ.rcov.dir)}/"]
-PROJ.exclude.flatten!
-PROJ.rdoc_exclude.flatten!
-PROJ.annotation_exclude.flatten!
+flatten_arrays = lambda do |this,os|
+ os.instance_variable_get(:@table).each do |key,val|
+ next if key == :dependencies
+ case val
+ when Array; val.flatten!
+ when OpenStruct; this.call(this,val)
+ end
+ end
+ end
+flatten_arrays.call(flatten_arrays,PROJ)
PROJ.changes ||= paragraphs_of(PROJ.history_file, 0..1).join("\n\n")
PROJ.description ||= paragraphs_of(PROJ.readme_file, 'description').join("\n\n")
PROJ.summary ||= PROJ.description.split('.').first
-PROJ.files ||=
+PROJ.gem.files ||=
if test(?f, PROJ.manifest_file)
files = File.readlines(PROJ.manifest_file).map {|fn| fn.chomp.strip}
files.delete ''
files
else [] end
-PROJ.executables ||= PROJ.files.find_all {|fn| fn =~ %r/^bin/}
+PROJ.gem.executables ||= PROJ.gem.files.find_all {|fn| fn =~ %r/^bin/}
-PROJ.rdoc_main ||= PROJ.readme_file
+PROJ.rdoc.main ||= PROJ.readme_file
# EOF