Skip to content

Commit

Permalink
Add publish target for website
Browse files Browse the repository at this point in the history
  • Loading branch information
hallidave committed Oct 21, 2011
1 parent e0b3c20 commit 6497fd9
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,27 @@ Rake::RDocTask.new do |doc|
doc.title = "SNMP Library for Ruby"
end

desc "Generate website content"
task :web => :rdoc do
ROOT_PATH = File.dirname(File.expand_path(__FILE__))
SRC_DIR = ROOT_PATH + "/web/content"
DEST_DIR = ROOT_PATH + "/web/site"

rm_rf DEST_DIR
mkdir_p DEST_DIR

Dir.glob(SRC_DIR + "/*").each do |name|
puts "#{name}...copying"
FileUtils.cp(name, DEST_DIR + "/" + File.basename(name))
namespace :web do
desc "Generate website content"
task :gen => :rdoc do
ROOT_PATH = File.dirname(File.expand_path(__FILE__))
SRC_DIR = ROOT_PATH + "/web/content"
DEST_DIR = ROOT_PATH + "/web/site"

rm_rf DEST_DIR
mkdir_p DEST_DIR

Dir.glob(SRC_DIR + "/*").each do |name|
puts "#{name}...copying"
cp name, DEST_DIR + "/" + File.basename(name)
end

puts "Documentation...copying"
cp_r ROOT_PATH + "/doc", DEST_DIR + "/doc"
end

puts "Documentation...copying"
cp_r(ROOT_PATH + "/doc", DEST_DIR + "/doc")
end
desc "Publish website to RubyForge"
task :publish => :gen do
sh "scp -r web/site/* davehal@rubyforge.org:/var/www/gforge-projects/snmplib"
end
end

0 comments on commit 6497fd9

Please sign in to comment.