require 'rake' require 'rake/testtask' require 'rake/rdoctask' desc 'Translate this gem' task :translate do file = File.join(File.dirname(__FILE__), 'locales', 'en.yml') system("babelphish -o -y #{file}") end begin require 'jeweler' Jeweler::Tasks.new do |gem| gem.name = "muck-users" gem.summary = "Easy to use user engine for Rails" gem.email = "justinball@gmail.com" gem.homepage = "http://github.com/jbasdf/muck_users" gem.description = "Easily add user signup, login and other features to your application" gem.authors = ["Justin Ball"] gem.rubyforge_project = "muck-users" gem.add_dependency "authlogic" gem.add_dependency "binarylogic-searchlogic" gem.add_dependency "bcrypt-ruby" gem.add_dependency "muck-engine" gem.files.include %w( tasks/* db/migrate/*.rb app/**/**/**/* config/* locales/* rails/* test/* lib/**/* ) end rescue LoadError puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler" end # rubyforge tasks begin require 'rake/contrib/sshpublisher' namespace :rubyforge do desc "Release gem and RDoc documentation to RubyForge" task :release => ["rubyforge:release:gem", "rubyforge:release:docs"] namespace :release do desc "Publish RDoc to RubyForge." task :docs => [:rdoc] do config = YAML.load( File.read(File.expand_path('~/.rubyforge/user-config.yml')) ) host = "#{config['username']}@rubyforge.org" remote_dir = "/var/www/gforge-projects/muck-users/" local_dir = 'rdoc' Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload end end end rescue LoadError puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured." end desc 'Test the muck_users gem.' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.libs << 'test/rails_root/test' t.pattern = 'test/rails_root/test/**/*_test.rb' t.verbose = true end begin require 'rcov/rcovtask' Rcov::RcovTask.new do |test| test.libs << 'test' test.pattern = 'test/**/*_test.rb' test.verbose = true end rescue LoadError task :rcov do abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov" end end task :default => :test require 'rake/rdoctask' Rake::RDocTask.new do |rdoc| if File.exist?('VERSION.yml') config = YAML.load(File.read('VERSION.yml')) version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}" else version = "" end rdoc.rdoc_dir = 'rdoc' rdoc.title = "muck_users #{version}" rdoc.rdoc_files.include('README*') rdoc.rdoc_files.include('lib/**/*.rb') end