require 'rubygems' require 'rake/testtask' require 'rake/rdoctask' require 'rake/gempackagetask' ADHEARSION_VERSION = File.read '.version' Summary = %{Adhearsion is a professional integration system for integrating anything and everything.} #task :default => [:test] #desc "Run the Adhearsion unit tests" #task :test do # Dir['test/*.rb'].each do |f| require f end #end gem_spec = Gem::Specification.new do |s| s.name = 'adhearsion' s.rubyforge_project = 'adhearsion' s.author = 'Jay Phillips' s.email = 'admin -at- jicksta dot com' s.version = ADHEARSION_VERSION s.summary = Summary s.homepage = 'http://adhearsion.com' s.add_dependency 'activerecord', '>= 1.14.4' s.add_dependency 'activesupport', '>= 1.3.1' s.add_dependency 'rake', '>= 0.7.1' s.platform = Gem::Platform::RUBY s.require_path = 'lib' s.executables = 'ahn' s.bindir = '.' #s.extra_rdoc_files = ['LICENSE'] include = Dir['**/*'] exclude = Dir['{log,pkg}/**/*'] s.files = include - exclude # test_files = Dir['tests/*.rb'] # Will be added when not so buggy end Rake::GemPackageTask.new gem_spec do |pkg| pkg.need_zip = false pkg.need_tar = false end #desc "Generate documentation for Adhearsion" #Rake::RDocTask.new do |rdoc| # rdoc.rdoc_dir 'doc' #end desc "Pulls down the entire wiki in HTML format" task :wiki => [:rm_wiki] do require 'open-uri' File.open "wiki.zip",'a' do |f| f.write open('http://adhearsion.stikipad.com/codex/export_html').read end Dir.mkdir 'docs' unless File.exists? 'docs' `unzip -d docs/wiki wiki.zip` File.delete 'wiki.zip' puts `find docs/wiki` end desc "Removes all cached compiled RubyInline shared objects" task :purge_objects do `rm -rf ~/.ruby_inline/*` end desc "Removes the local copy of the wiki" task :rm_wiki do `rm -rf wiki.zip docs/wiki/` end desc "Prepares Adhearsion for a new release" task :prepare_release do # Remove log files Dir['log/*.log'].each do |f| puts "Removing file #{f}" File.delete f end # Check for unversioned files unversioned_files = `svn st | grep '^\?' | awk '{ print $2 }'` puts "WARNING: These files are not under version control: #{unversioned_files}" unless unversioned_files.empty? end desc "Simply prints the Adhearsion version." task :version do puts ADHEARSION_VERSION end desc 'Generate sample databases' task :migrate do # Coming soon end desc 'Reinstall the gem' task :update => [:repackage] do if `whoami`.chomp != 'root' puts "Must run this as root!" exit 1 end puts `gem uninstall adhearsion` `gem install pkg/adhearsion*.gem` puts "Done." end desc 'Create both the gem and the Trixbox RPM. Called "d" for "distribute"' task :d => [:repackage] do # Coming soon end