2008-06-20 11:54:25 -07:00
require 'rake'
2008-09-11 22:21:16 -07:00
require "rake/rdoctask"
2008-10-26 10:03:59 -05:00
require 'rake/gempackagetask'
2009-01-12 21:33:12 -08:00
require File.join(File.expand_path(File.dirname(__FILE__)),'lib','couchrest')
2009-01-12 23:46:21 -08:00
begin
require 'spec/rake/spectask'
rescue LoadError
puts <<-EOS
To use rspec for testing you must install rspec gem:
gem install rspec
EOS
exit(0)
end
2008-09-12 15:45:21 -04:00
spec = Gem::Specification.new do |s|
s.name = "couchrest"
2009-01-12 21:33:12 -08:00
s.version = CouchRest::VERSION
2008-11-22 14:16:44 -08:00
s.date = "2008-11-22"
2008-09-12 15:45:21 -04:00
s.summary = "Lean and RESTful interface to CouchDB."
2009-01-08 22:22:34 -08:00
s.email = "jchris@apache.org"
2008-09-12 15:45:21 -04:00
s.homepage = "http://github.com/jchris/couchrest"
s.description = "CouchRest provides a simple interface on top of CouchDB's RESTful HTTP API, as well as including some utility scripts for managing views and attachments."
s.has_rdoc = true
2009-02-12 20:28:07 -08:00
s.authors = ["J. Chris Anderson", "Matt Aimonetti"]
2009-01-12 20:40:06 -08:00
s.files = %w( LICENSE README.md Rakefile THANKS.md ) +
2009-01-19 16:11:58 -08:00
Dir["{examples,lib,spec,utils}/**/*"] -
2009-01-08 22:18:06 -08:00
Dir["spec/tmp"]
2009-01-12 20:40:06 -08:00
s.extra_rdoc_files = %w( README.md LICENSE THANKS.md )
2008-09-12 15:45:21 -04:00
s.require_path = "lib"
2008-09-12 15:56:26 -04:00
s.add_dependency("rest-client", ">= 0.5")
2009-01-12 21:14:35 -08:00
s.add_dependency("mime-types", ">= 1.15")
2008-09-12 15:45:21 -04:00
end
2008-10-26 10:03:59 -05:00
2009-03-25 13:48:55 -07:00
desc "Create .gemspec file (useful for github)"
2008-09-30 10:22:17 -07:00
task :gemspec do
2009-01-12 23:46:21 -08:00
filename = "#{spec.name}.gemspec"
File.open(filename, "w") do |f|
f.puts spec.to_ruby
2008-09-12 15:45:21 -04:00
end
end
2009-03-25 13:48:55 -07:00
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
desc "Install the gem locally"
task :install => [:package] do
sh %{sudo gem install pkg/couchrest-#{CouchRest::VERSION}}
end
2008-06-20 11:54:25 -07:00
desc "Run all specs"
Spec::Rake::SpecTask.new('spec') do |t|
2008-10-06 12:27:01 -07:00
t.spec_files = FileList['spec/**/*_spec.rb']
2008-06-20 11:54:25 -07:00
end
desc "Print specdocs"
Spec::Rake::SpecTask.new(:doc) do |t|
2008-09-29 21:08:52 -07:00
t.spec_opts = ["--format", "specdoc"]
2008-06-20 11:54:25 -07:00
t.spec_files = FileList['spec/*_spec.rb']
end
2008-09-11 22:21:16 -07: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-14 15:39:40 -07:00
desc "Run the rspec"
2008-06-20 15:06:11 -07:00
task :default => :spec