]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/composite_primary_keys-2.2.2/Rakefile
Include the user description in the spam score
[rails.git] / vendor / gems / composite_primary_keys-2.2.2 / Rakefile
1 require 'rubygems'
2 require 'rake'
3 require 'rake/clean'
4 require 'rake/testtask'
5 require 'rake/rdoctask'
6 require 'rake/packagetask'
7 require 'rake/gempackagetask'
8 require 'rake/contrib/rubyforgepublisher'
9 require 'fileutils'
10 require 'hoe'
11 include FileUtils
12 require File.join(File.dirname(__FILE__), 'lib', 'composite_primary_keys', 'version')
13
14 AUTHOR = "Dr Nic Williams"
15 EMAIL = "drnicwilliams@gmail.com"
16 DESCRIPTION = "Composite key support for ActiveRecords"
17 GEM_NAME = "composite_primary_keys" # what ppl will type to install your gem
18 if File.exists?("~/.rubyforge/user-config.yml")
19   # TODO this should prob go in a local/ file
20   config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
21   RUBYFORGE_USERNAME = config["username"]
22 end
23 RUBYFORGE_PROJECT = "compositekeys"
24 HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
25
26 REV = nil #File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
27 VERS = ENV['VERSION'] || (CompositePrimaryKeys::VERSION::STRING + (REV ? ".#{REV}" : ""))
28 CLEAN.include ['**/.*.sw?', '*.gem', '.config','debug.log','*.db','logfile','log/**/*','**/.DS_Store', '.project']
29 RDOC_OPTS = ['--quiet', '--title', "newgem documentation",
30     "--opname", "index.html",
31     "--line-numbers", 
32     "--main", "README",
33     "--inline-source"]
34
35 class Hoe
36   def extra_deps 
37     @extra_deps.reject { |x| Array(x).first == 'hoe' } 
38   end 
39 end
40
41 # Generate all the Rake tasks
42 # Run 'rake -T' to see list of generated tasks (from gem root directory)
43 hoe = Hoe.new(GEM_NAME, VERS) do |p|
44   p.author = AUTHOR 
45   p.description = DESCRIPTION
46   p.email = EMAIL
47   p.summary = DESCRIPTION
48   p.url = HOMEPATH
49   p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
50   p.test_globs = ["test/**/test*.rb"]
51   p.clean_globs |= CLEAN  #An array of file patterns to delete on clean.
52
53   # == Optional
54   p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
55   p.extra_deps = [['activerecord', '>= 2.2.0']]  #An array of rubygem dependencies.
56   #p.spec_extras    - A hash of extra values to set in the gemspec.
57 end
58
59 CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\n\n")
60 PATH    = RUBYFORGE_PROJECT
61 hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
62
63 PROJECT_ROOT = File.expand_path(".")
64
65 require 'loader'