4 require 'rake/testtask'
5 require 'rake/rdoctask'
6 require 'rake/packagetask'
7 require 'rake/gempackagetask'
8 require 'rake/contrib/rubyforgepublisher'
12 require File.join(File.dirname(__FILE__), 'lib', 'composite_primary_keys', 'version')
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"]
23 RUBYFORGE_PROJECT = "compositekeys"
24 HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
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",
37 @extra_deps.reject { |x| Array(x).first == 'hoe' }
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|
45 p.description = DESCRIPTION
47 p.summary = DESCRIPTION
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.
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.
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')
63 PROJECT_ROOT = File.expand_path(".")