2008-06-20 20:54:25 +02:00
require 'rake'
2008-09-12 07:21:16 +02:00
require " rake/rdoctask "
2010-06-20 22:01:11 +02:00
$LOAD_PATH . unshift File . expand_path ( " ../lib " , __FILE__ )
require 'couchrest_model'
2009-01-13 06:33:12 +01:00
2009-01-13 08:46:21 +01:00
begin
2010-08-18 20:00:03 +02:00
require 'rspec'
require 'rspec/core/rake_task'
2009-01-13 08:46:21 +01:00
rescue LoadError
puts <<-EOS
To use rspec for testing you must install rspec gem :
gem install rspec
EOS
exit ( 0 )
end
2010-01-14 00:33:23 +01:00
begin
require 'jeweler'
Jeweler :: Tasks . new do | gemspec |
2010-06-20 22:01:11 +02:00
gemspec . name = " couchrest_model "
gemspec . summary = " Extends the CouchRest Document for advanced modelling. "
gemspec . description = " CouchRest Model provides aditional features to the standard CouchRest Document class such as properties, view designs, associations, callbacks, typecasting and validations. "
2010-01-14 00:33:23 +01:00
gemspec . email = " jchris@apache.org "
2010-06-20 22:01:11 +02:00
gemspec . homepage = " http://github.com/couchrest/couchrest_model "
gemspec . authors = [ " J. Chris Anderson " , " Matt Aimonetti " , " Marcos Tapajos " , " Will Leinweber " , " Sam Lown " ]
2010-01-14 00:33:23 +01:00
gemspec . extra_rdoc_files = %w( README.md LICENSE THANKS.md )
2010-08-04 04:11:35 +02:00
gemspec . files = %w( LICENSE README.md Rakefile THANKS.md history.txt couchrest.gemspec ) + Dir [ " {examples,lib,spec}/**/* " ] - Dir [ " spec/tmp " ]
2010-01-14 00:33:23 +01:00
gemspec . has_rdoc = true
2010-10-22 15:39:12 +02:00
gemspec . add_dependency ( " couchrest " , " ~> 1.0.1 " )
2010-08-23 13:49:23 +02:00
gemspec . add_dependency ( " mime-types " , " ~> 1.15 " )
gemspec . add_dependency ( " activemodel " , " ~> 3.0.0.rc " )
gemspec . add_dependency ( " tzinfo " , " ~> 0.3.22 " )
2010-08-24 11:45:37 +02:00
gemspec . add_dependency ( 'railties' , " ~> 3.0.0.rc " )
2010-08-23 13:49:23 +02:00
gemspec . add_development_dependency ( 'rspec' , '~> 2.0.0.beta.19' )
2010-06-20 22:01:11 +02:00
gemspec . version = CouchRest :: Model :: VERSION
2010-07-29 02:38:50 +02:00
gemspec . date = Time . now . strftime ( " %Y-%m-%d " )
2010-01-14 00:33:23 +01:00
gemspec . require_path = " lib "
2008-09-12 21:45:21 +02:00
end
2010-01-14 00:33:23 +01:00
rescue LoadError
puts " Jeweler not available. Install it with: gem install jeweler "
2009-03-25 21:48:55 +01:00
end
2008-06-20 20:54:25 +02:00
desc " Run all specs "
2010-08-18 20:00:03 +02:00
Rspec :: Core :: RakeTask . new ( :spec ) do | spec |
spec . spec_opts = [ " --color " ]
spec . pattern = 'spec/**/*_spec.rb'
2008-06-20 20:54:25 +02:00
end
desc " Print specdocs "
2010-08-18 20:00:03 +02:00
Rspec :: Core :: RakeTask . new ( :doc ) do | spec |
spec . spec_opts = [ " --format " , " specdoc " ]
spec . pattern = 'spec/*_spec.rb'
2008-06-20 20:54:25 +02:00
end
2008-09-12 07:21:16 +02:00
desc " Generate the rdoc "
Rake :: RDocTask . new do | rdoc |
files = [ " README.rdoc " , " LICENSE " , " lib/**/*.rb " ]
rdoc . rdoc_files . add ( files )
rdoc . main = " README.rdoc "
rdoc . title = " CouchRest: Ruby CouchDB, close to the metal "
end
2008-10-15 00:39:40 +02:00
desc " Run the rspec "
2008-06-21 00:06:11 +02:00
task :default = > :spec
2010-01-14 12:56:28 +01:00
module Rake
def self . remove_task ( task_name )
Rake . application . instance_variable_get ( '@tasks' ) . delete ( task_name . to_s )
end
end
Rake . remove_task ( " github:release " )
2010-03-16 01:12:38 +01:00
Rake . remove_task ( " release " )