1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Add support to build/re-build/clobber gem/package/docs

This commit is contained in:
Chirag Jog 2012-05-03 00:39:06 -07:00
parent d0057ed136
commit 189dd88397

View file

@ -1,4 +1,6 @@
require 'rubygems'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'bundler/setup'
require 'date'
require File.dirname(__FILE__) + '/lib/fog'
@ -44,6 +46,36 @@ end
#
#############################################################################
GEM_NAME = "#{name}"
spec = eval(File.read("#{gemspec_file}"))
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
begin
require 'sdoc'
Rake::RDocTask.new do |rdoc|
rdoc.title = "Fog Documentation"
rdoc.main = "README.rdoc"
rdoc.options << '--fmt' << 'shtml' # explictly set shtml generator
rdoc.template = 'direct' # lighter template
rdoc.rdoc_files.include("README.rdoc", "LICENSE", "lib/**/*.rb")
rdoc.rdoc_dir = "rdoc"
end
rescue LoadError
puts "sdoc is not available. (sudo) gem install sdoc to generate rdoc documentation."
end
task :install => :package do
sh %{gem install pkg/#{GEM_NAME}-#{version} --no-rdoc --no-ri}
end
task :uninstall do
sh %{gem uninstall #{GEM_NAME} -x -v #{version} }
end
task :default => :test
namespace :test do