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