################################################################################ # # Copyright (C) 2006 Peter J Jones (pjones@pmade.com) # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # ################################################################################ require 'rubygems' Gem::manage_gems require 'rake/testtask' require 'rake/rdoctask' require 'rake/gempackagetask' ################################################################################ SCRAPES_VERSION = '0.2.0' RDOC_FILES = ["README", "LICENSE"] ################################################################################ desc "Default Task" task :default => [:test] ################################################################################ # Create the documentation. Rake::RDocTask.new do |rdoc| rdoc.main = "README" rdoc.rdoc_files.include(*(RDOC_FILES.concat(Dir.glob("lib/**/*.rb")))) rdoc.title = 'Scrapes' end ################################################################################ # Setup tests Rake::TestTask.new :test do |test| test.verbose = true test.test_files = ['test/*.rb'] end ################################################################################ # Create the GEM package. gem_spec = Gem::Specification.new do |spec| spec.name = 'scrapes' spec.version = SCRAPES_VERSION spec.summary = "Web site scraping framework" spec.author = "Peter Jones" spec.email = "pjones@pmade.com" spec.homepage = "http://pmade.com/open-source-software/scrapes/" spec.require_path = "lib" spec.autorequire = 'scrapes.rb' spec.has_rdoc = true spec.rdoc_options << '--main' << 'README' << '--title' << spec.name << '--line-numbers' spec.extra_rdoc_files = RDOC_FILES spec.rubyforge_project = spec.name candidates = Dir.glob("{lib,demo,test}/**/*") spec.files = candidates.delete_if {|c| c.match(/\.swp|\.svn|rdoc/)} spec.add_dependency('hpricot', '>= 0.4.59') spec.add_dependency('rextra', '>= 2.0.4') end gem = Rake::GemPackageTask.new(gem_spec) do |pkg| pkg.need_tar = true pkg.need_zip = true end ################################################################################ desc "Make a new release" task :release => [:test, :clobber, :package] do puts puts "==> made version #{SCRAPES_VERSION}" end