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:
parent
d0057ed136
commit
189dd88397
1 changed files with 32 additions and 0 deletions
32
Rakefile
32
Rakefile
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue