public
Fork of vigetlabs/foreign_key_migrations
Description: A gem/plugin for ActiveRecord that lets you define foreign keys in migrations.
Clone URL: git://github.com/crnixon/foreign_key_migrations.git
foreign_key_migrations / bones_tasks / post_load.rake
100644 39 lines (28 sloc) 1.077 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# $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.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
      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 ||=
  if test(?f, PROJ.manifest_file)
    files = File.readlines(PROJ.manifest_file).map {|fn| fn.chomp.strip}
    files.delete ''
    files
  else [] end
 
PROJ.gem.executables ||= PROJ.gem.files.find_all {|fn| fn =~ %r/^bin/}
 
PROJ.rdoc.main ||= PROJ.readme_file
 
# EOF