Sha256: 969bde68ad15a8478dc830af370e238e2f7d410e45a9c66c7c5c09fd3a8da4cb

Contents?: true

Size: 1.25 KB

Versions: 2

Compression:

Stored size: 1.25 KB

Contents

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/clean'

require 'rubygems/package_task'

# test target
Rake::TestTask.new do |test|
    test.libs  << "lib"
end

# package target
CLEAN.include 'pkg'
CLEAN.include 'doc'
CLEAN.include 'web/site'

spec = Gem::Specification.load "snmp.gemspec"

Gem::PackageTask.new(spec) do |package|
    package.need_zip = false
    package.need_tar = false
end

# rdoc, clobber_rdoc, rerdoc targets
Rake::RDocTask.new do |doc|
    doc.rdoc_dir = "doc"
    doc.main = "README.rdoc"
    doc.rdoc_files.include('README.rdoc', 'lib/**/*.rb')
    doc.title = "SNMP Library for Ruby"
end 

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

  desc "Publish website to RubyForge"
  task :publish => :gen do
    sh "scp -r web/site/* davehal@rubyforge.org:/var/www/gforge-projects/snmplib"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
snmp-1.1.0 Rakefile
snmp-1.0.4 Rakefile