Rakefile in glue-0.0.1 vs Rakefile in glue-0.13.0
- old
+ new
@@ -1,14 +1,77 @@
-# -*- ruby -*-
+# * George Moschovitis <gm@navel.gr>
+# (c) 2004-2005 Navel, all rights reserved.
+# $Id$
-require 'rubygems'
-require 'hoe'
-require './lib/glue.rb'
+require 'rake/rdoctask'
+require 'rake/testtask'
+require 'rake/gempackagetask'
-Hoe.new('glue', Glue::VERSION) do |p|
- p.developer('Jordan Dobson', 'jordan.dobson@madebysquad.com')
- p.extra_deps = ['mechanize']
- p.extra_deps = ['httparty']
- p.extra_dev_deps = ['mocha']
+task :default => :package
+
+# Run all tests.
+
+Rake::TestTask.new(:test_all) do |t|
+ t.libs << 'test'
+ t.test_files = FileList['test/**/tc*.rb']
+ t.verbose = true
end
-# vim: syntax=Ruby
+# Generate RDoc documentation.
+
+Rake::RDocTask.new do |rd|
+ rd.main = 'README'
+ rd.rdoc_dir = 'doc/rdoc'
+ rd.rdoc_files.include('README', 'INSTALL', 'lib/**/*.rb')
+ rd.options << '--all --inline-source'
+end
+
+# Build gem.
+
+spec = Gem::Specification.new do |s|
+ s.name = 'glue'
+ if File.read('lib/glue.rb') =~ /Version\s+=\s+'(\d+\.\d+\.\d+)'/
+ s.version = $1
+ else
+ raise 'No version found'
+ end
+ s.summary = 'Glue utilities'
+ s.description = 'A collection of utilities and useful classes'
+ s.add_dependency 'extensions', '>= 0.5'
+ s.add_dependency 'flexmock', '>= 0.0.3'
+
+ s.required_ruby_version = '>= 1.8.1'
+
+ s.files = FileList[
+ '[A-Z]*', 'install.rb', '{doc,lib,test,vendor}/**/*'
+ ].exclude('.svn/**/*').exclude('**/*.log').to_a
+
+ s.require_path = 'lib'
+ s.autorequire = 'glue'
+
+ s.has_rdoc = true
+ s.extra_rdoc_files = FileList['[A-Z]*'].exclude('*.og').to_a
+ s.rdoc_options << '--main' << 'README' << '--title' << 'Glue Documentation'
+ s.rdoc_options << '--all' << '--inline-source'
+
+ s.test_files = []
+
+ s.bindir = 'bin'
+
+ s.author = 'George Moschovitis'
+ s.email = 'gm@navel.gr'
+ s.homepage = 'http://nitro.rubyforge.org'
+ s.rubyforge_project = 'nitro'
+end
+
+Rake::GemPackageTask.new(spec) do |pkg|
+ pkg.package_dir = 'dist'
+ pkg.need_zip = true
+ pkg.need_tar = true
+end
+
+# Manual install (not recommended).
+
+task :install do
+ ruby 'install.rb'
+end
+