root / Rakefile

1 1bcb17e0 Simone
 require 'rubygems'
2 1bcb17e0 Simone
 require 'echoe'
3 1bcb17e0 Simone
4 1bcb17e0 Simone
 $LOAD_PATH.unshift(File.dirname(__FILE__) + "/lib")
5 1bcb17e0 Simone
 require 'multi_conditions'
6 1bcb17e0 Simone
7 c9efba16 Simone
8 1bcb17e0 Simone
 # Common package properties
9 1bcb17e0 Simone
 PKG_NAME    = ENV['PKG_NAME'] || ActiveRecord::Base::MultiConditions::GEM
10 1bcb17e0 Simone
 PKG_VERSION = ENV['PKG_VERSION'] || ActiveRecord::Base::MultiConditions::VERSION
11 1bcb17e0 Simone
 PKG_SUMMARY = "An ActiveRecord plugin for dealing with complex search :conditions."
12 1bcb17e0 Simone
 PKG_FILES   = FileList.new("{lib,test}/**/*.rb") do |fl|
13 1bcb17e0 Simone
   fl.exclude 'TODO'
14 c984e4e9 Simone
   fl.include %w(README.rdoc CHANGELOG.rdoc LICENSE.rdoc)
15 1bcb17e0 Simone
   fl.include %w(Rakefile setup.rb)
16 1bcb17e0 Simone
 end
17 1bcb17e0 Simone
 RUBYFORGE_PROJECT = 'activerecord-multiconditions'
18 1bcb17e0 Simone
19 9a57c0d9 Simone
20 9a57c0d9 Simone
 # Prepare version number, don't forget about snapshots!
21 9a57c0d9 Simone
 version = PKG_VERSION
22 ee4fc378 Simone
 if ENV['SNAPSHOT'].to_i == 1
23 9a57c0d9 Simone
   version << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
24 ee4fc378 Simone
 end
25 1bcb17e0 Simone
26 c9efba16 Simone
27 9a57c0d9 Simone
 Echoe.new(PKG_NAME, version) do |p|
28 1bcb17e0 Simone
   p.author = "Simone Carletti"
29 1bcb17e0 Simone
   p.email = "weppos@weppos.net"
30 1bcb17e0 Simone
   p.summary     = PKG_SUMMARY
31 1bcb17e0 Simone
   p.description = <<-EOF
32 1bcb17e0 Simone
     MultiConditions is a simple ActiveRecord plugin \
33 1bcb17e0 Simone
     for storing ActiveRecord query conditions and make complex queries painless.
34 1bcb17e0 Simone
     EOF
35 1bcb17e0 Simone
   p.url = "http://code.simonecarletti.com/activerecord-multiconditions"
36 1bcb17e0 Simone
37 1bcb17e0 Simone
   p.version = PKG_VERSION
38 1bcb17e0 Simone
   p.changes = ''
39 1bcb17e0 Simone
40 1bcb17e0 Simone
   p.dependencies = ['activerecord >=2.0.0']
41 1bcb17e0 Simone
   p.rcov_options = ["-xRakefile"]
42 1bcb17e0 Simone
43 1bcb17e0 Simone
   p.need_zip = true
44 1bcb17e0 Simone
   p.include_rakefile = true
45 1bcb17e0 Simone
46 1bcb17e0 Simone
   p.project = RUBYFORGE_PROJECT
47 1bcb17e0 Simone
48 c984e4e9 Simone
   p.rdoc_pattern = /^(lib|CHANGELOG.rdoc|LICENSE.rdoc|README.rdoc)/
49 1bcb17e0 Simone
 end
50 1bcb17e0 Simone
51 1bcb17e0 Simone
52 1bcb17e0 Simone
 begin
53 1bcb17e0 Simone
   require 'code_statistics'
54 1bcb17e0 Simone
   desc "Show library's code statistics"
55 1bcb17e0 Simone
   task :stats do
56 1bcb17e0 Simone
     CodeStatistics.new(["MultiConditions", "lib"],
57 1bcb17e0 Simone
                        ["Tests", "test"]).to_s
58 1bcb17e0 Simone
   end
59 1bcb17e0 Simone
 rescue LoadError
60 1bcb17e0 Simone
   puts "CodeStatistics (Rails) is not available"
61 1bcb17e0 Simone
 end