4 require 'rake/testtask'
\r
5 require 'rake/rdoctask'
\r
6 require 'rake/packagetask'
\r
7 require 'rake/gempackagetask'
\r
8 require 'rake/contrib/rubyforgepublisher'
\r
12 require File.join(File.dirname(__FILE__), 'lib', 'composite_primary_keys', 'version')
\r
14 AUTHOR = "Dr Nic Williams"
\r
15 EMAIL = "drnicwilliams@gmail.com"
\r
16 DESCRIPTION = "Composite key support for ActiveRecords"
\r
17 GEM_NAME = "composite_primary_keys" # what ppl will type to install your gem
\r
18 if File.exists?("~/.rubyforge/user-config.yml")
\r
19 # TODO this should prob go in a local/ file
\r
20 config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
\r
21 RUBYFORGE_USERNAME = config["username"]
\r
23 RUBYFORGE_PROJECT = "compositekeys"
\r
24 HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
\r
26 REV = nil #File.read(".svn/entries")[/committed-rev="(\d+)"/, 1] rescue nil
\r
27 VERS = ENV['VERSION'] || (CompositePrimaryKeys::VERSION::STRING + (REV ? ".#{REV}" : ""))
\r
28 CLEAN.include ['**/.*.sw?', '*.gem', '.config','debug.log','*.db','logfile','log/**/*','**/.DS_Store', '.project']
\r
29 RDOC_OPTS = ['--quiet', '--title', "newgem documentation",
\r
30 "--opname", "index.html",
\r
37 @extra_deps.reject { |x| Array(x).first == 'hoe' }
\r
41 # Generate all the Rake tasks
\r
42 # Run 'rake -T' to see list of generated tasks (from gem root directory)
\r
43 hoe = Hoe.new(GEM_NAME, VERS) do |p|
\r
45 p.description = DESCRIPTION
\r
47 p.summary = DESCRIPTION
\r
49 p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
\r
50 p.test_globs = ["test/**/test*.rb"]
\r
51 p.clean_globs |= CLEAN #An array of file patterns to delete on clean.
\r
54 p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
\r
55 p.extra_deps = [['activerecord', '>= 2.2.0']] #An array of rubygem dependencies.
\r
56 #p.spec_extras - A hash of extra values to set in the gemspec.
\r
59 CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\n\n")
\r
60 PATH = RUBYFORGE_PROJECT
\r
61 hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
\r
63 PROJECT_ROOT = File.expand_path(".")
\r