# Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/switchtower.rake, and they will automatically be available to Rake. #require(File.join(File.dirname(__FILE__), 'config', 'boot')) require(File.join(File.dirname(__FILE__), 'config', 'environment')) require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'rake/gempackagetask' require 'tasks/rails' require 'meta_project' require 'rake/contrib/rubyforgepublisher' require 'meta_project/release/freshmeat' require 'meta_project/release/raa' desc "Deploy basic application directories" task :deploy => :environment do # public is missing dirs = %w{ app lib test config} onserver = "manu@vvv:/home/manu/develop/parlement/" dirs.each do | dir| `rsync -a --delete "#{RAILS_ROOT}/#{dir}" "#{onserver}" --exclude ".svn"` end end PKG_NAME = "parlement" PKG_VERSION = PARLEMENT_VERSION PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}" PKG_FILES = FileList[ '[A-Z]*', 'app/**/*', 'components/**/*', 'config/**/*', 'db/**/*', 'lib/**/*', 'public/*.*', 'public/dynamic/*', 'public/images/*', 'public/engine_files/*', 'public/engine_files/**/*', 'public/javascripts/*', 'public/stylesheets/*', 'script/*', 'script/**/*' 'test/**/*', 'vendor/**/*' ].exclude(/\b(svn|tmp|attachment)\b|~$/) spec = Gem::Specification.new do |s| ## Basic information. s.name = PKG_NAME s.version = PKG_VERSION s.summary = "Trusted Direct Democracy on a forum" s.description = < [:verify_env_vars, :release_files, :publish_doc, :publish_news] task :release => [:release_files, :publish_news] task :verify_env_vars do if not ENV["RUBYFORGE_USER"] print "rubyforge.org's user: " ENV["RUBYFORGE_USER"] = STDIN.gets.chomp end # This echos password to shell which is a bit sucky if ENV["RUBYFORGE_PASSWORD"] password = ENV["RUBYFORGE_PASSWORD"] else print "#{ENV['RUBYFORGE_USER']}@rubyforge.org's password: " ENV["RUBYFORGE_PASSWORD"] = STDIN.gets.chomp end raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER'] raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD'] if not ENV["FRESHMEAT_USER"] print "freshmeat user: " ENV["FRESHMEAT_USER"] = STDIN.gets.chomp end # This echos password to shell which is a bit sucky if ENV["FRESHMEAT_PASSWORD"] password = ENV["FRESHMEAT_PASSWORD"] else print "freshmeat's password: " ENV["FRESHMEAT_PASSWORD"] = STDIN.gets.chomp end end task :publish_doc do publisher = Rake::RubyForgePublisher.new(PKG_NAME, ENV['RUBYFORGE_USER']) publisher.upload end desc "Release files on RubyForge" task :release_files => [:verify_env_vars, :package] do release_files = FileList[ "pkg/#{PKG_FILE_NAME}.gem", "pkg/#{PKG_FILE_NAME}.tgz", "pkg/#{PKG_FILE_NAME}.zip" ] Rake::XForge::Release.new(MetaProject::Project::XForge::RubyForge.new(PKG_NAME)) do |release| # Never hardcode user name and password in the Rakefile! release.user_name = ENV['RUBYFORGE_USER'] release.password = ENV['RUBYFORGE_PASSWORD'] #puts "login: ", ENV['RUBYFORGE_USER'] #puts "password: ", ENV['RUBYFORGE_PASSWORD'] release.files = release_files.to_a release.release_name = "#{PKG_NAME} #{PKG_VERSION}" # The rest of the options are defaults (among others, release_notes and release_changes, parsed from CHANGES) end end desc "Publish news" task :publish_news => [:verify_env_vars] do #release_files = FileList[ "pkg/#{PKG_FILE_NAME}.gem", # "pkg/#{PKG_FILE_NAME}.tgz", # "pkg/#{PKG_FILE_NAME}.zip" ] Rake::XForge::NewsPublisher.new(MetaProject::Project::XForge::RubyForge.new(PKG_NAME)) do |news| # Never hardcode user name and password in the Rakefile! news.user_name = ENV['RUBYFORGE_USER'] news.password = ENV['RUBYFORGE_PASSWORD'] end """ fm = DevTools::Freshmeat::FreshmeatService.new(ENV['FRESHMEAT_USER'], ENV['FRESHMEAT_PASSWORD']) fm.get_project_list.each do |p| branches = fm.get_branch_list( p.shortName ) puts branches.inspect release = fm.get_release( p.shortName, branches[0], p.version ) if PKG_NAME == p.shortName puts p #release.version = PKG_VERSION #release.changes = PKG_VERSION end end puts fm.logout """ end