Sha256: 094f7bd8fd44e717ddc384441ce14d7ff550062828f1af3af6a4e568d41ba790

Contents?: true

Size: 1.69 KB

Versions: 1

Compression:

Stored size: 1.69 KB

Contents

rubyforge_project = "'module import'"
project = 'module-import'
desc "test"
task :test do
  Dir[ 'spec/*' ].each do |file|
    puts `spec #{file}`
    exit $?.exitstatus if $?.exitstatus != 0
  end
end

desc "release a new gem to rubyforge"
task :release => [:rdoc,:package] do
  Dir.chdir('pkg') do
    release = Dir['*.gem'].sort_by {|file| File.mtime(file)}.last
    release =~ /^[^-]+-([.0-9]+).gem$/
    `rubyforge login && rubyforge add_release #{project} #{project} #$1 #{release}`
  end
end

desc "generate documentation"
task :rdoc do
  fail unless system 'rdoc --force-update --quiet README lib/*'
end

namespace :readme do
  desc "create html for website using coderay, use --silent option"
  task :html => :rdoc do
    require 'hpricot'
    doc = open( 'doc/files/README.html' ) { |f| Hpricot(f) }
    # find example code
    doc.at('#description').search('pre').
      select {|elem| elem.inner_html =~ /class |module /}.each do |ex|
      # add coderay and undo what rdoc has done in the example code
      ex.swap("<coderay lang='ruby'>#{ex.inner_html.gsub('&quot;', '"').gsub('&gt;','>')}</coderay>")
    end
    puts doc.at('#description').to_html
  end
end

require 'rubygems'
require 'rake/gempackagetask'

spec = Gem::Specification.new do |s|
  s.name = project
  s.rubyforge_project = project
  s.version = "0.1.0"
  s.author = "Greg Weber"
  s.email = "greg@gregweber.info"
  s.homepage = "http://projects.gregweber.info/#{project}"
  s.platform = Gem::Platform::RUBY
  s.summary = "selectively import methods from modules"
  s.files = Dir['./**'] + Dir['*/**']
  s.require_path = "lib"
  s.has_rdoc = true
  s.extra_rdoc_files = ["README"]
end

Rake::GemPackageTask.new(spec) do |pkg|
  pkg.need_tar = false
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
module-import-0.1.0 ./rakefile