diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-03 22:27:16 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-03 22:27:16 +0200 |
commit | 2ee48c4f18470e733f244c659221e243ff998416 (patch) | |
tree | 62949886912b3dc5eb9e000b211e7f45f17ed978 /tasks/post_load.rake | |
download | edoors-ruby-2ee48c4f18470e733f244c659221e243ff998416.zip edoors-ruby-2ee48c4f18470e733f244c659221e243ff998416.tar.gz |
initial commit
Diffstat (limited to 'tasks/post_load.rake')
-rw-r--r-- | tasks/post_load.rake | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tasks/post_load.rake b/tasks/post_load.rake new file mode 100644 index 0000000..8ccdfc9 --- /dev/null +++ b/tasks/post_load.rake @@ -0,0 +1,35 @@ +# -*- coding: UTF-8 -*- +# +# 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.exclude << ["^#{Regexp.escape(PROJ.ann.file)}$", + "^#{Regexp.escape(PROJ.ignore_file)}$", + "^#{Regexp.escape(PROJ.rdoc.dir)}/", + "^#{Regexp.escape(PROJ.rcov.dir)}/"] + +flatten_arrays = lambda do |this,os| + os.instance_variable_get(:@table).each do |key,val| + next if key == :dependencies \ + or key == :development_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.gem.files ||= manifest + +PROJ.gem.executables ||= PROJ.gem.files.find_all {|fn| fn =~ %r/^bin/} + +PROJ.rdoc.main ||= PROJ.readme_file + +# EOF |