Rakefile in nanoc-2.0.4 vs Rakefile in nanoc-2.1

- old
+ new

@@ -2,29 +2,48 @@ require 'rake' require 'rake/clean' require 'rake/gempackagetask' +require 'rake/rdoctask' require 'rake/testtask' require File.dirname(__FILE__) + '/lib/nanoc.rb' ##### General details -NAME = 'nanoc' -VERS = Nanoc::VERSION -SUMMARY = 'a tool that runs on your local computer and compiles Markdown, ' + - 'Textile, Haml, ... documents into static web pages' +NAME = 'nanoc' +VERS = Nanoc::VERSION +SUMMARY = 'a tool that runs on your local computer and compiles ' + + 'Markdown, Textile, Haml, ... documents into static web pages' HOMEPAGE = 'http://nanoc.stoneship.org/' AUTHOR = 'Denis Defreyne' EMAIL = 'denis.defreyne@stoneship.org' +MESSAGE = <<EOS +Thanks for installing nanoc 2.1! Here are some resources to help you get started: + +* The tutorial at <http://nanoc.stoneship.org/help/tutorial/> +* The manual at <http://nanoc.stoneship.org/help/manual/> +* The discussion group at <http://groups.google.com/group/nanoc> + +Because nanoc 2.1 has a lot of new features, be sure to check out the nanoc blog at <http://nanoc.stoneship.org/blog/> for details about this release. + +Enjoy! +EOS + ##### Cleaning -CLEAN.include [ 'tmp', 'test/fixtures/*/output/*', 'test/fixtures/*/tmp' ] -CLOBBER.include [ 'pkg' ] +CLEAN.include([ + 'coverage', + 'rdoc', + 'tmp', + File.join('test', 'fixtures', '*', 'output', '*'), + File.join('test', 'fixtures', '*', 'tmp') +]) +CLOBBER.include([ 'pkg' ]) ##### Packaging spec = Gem::Specification.new do |s| s.name = NAME @@ -35,34 +54,62 @@ s.homepage = HOMEPAGE s.author = AUTHOR s.email = EMAIL + s.post_install_message = '-' * 78 + "\n" + MESSAGE + '-' * 78 + s.rubyforge_project = 'nanoc' s.required_ruby_version = '>= 1.8.5' - s.has_rdoc = false - s.files = %w( README LICENSE ChangeLog Rakefile ) + Dir['{bin,lib}/**/*'] + s.has_rdoc = true + s.extra_rdoc_files = [ 'README' ] + s.rdoc_options << '--title' << 'nanoc' << + '--main' << 'README' << + '--charset' << 'utf-8' << + '--exclude' << 'lib/nanoc/cli/commands' << + '--exclude' << 'lib/nanoc/binary_filters' << + '--exclude' << 'lib/nanoc/extra/vcses' << + '--exclude' << 'lib/nanoc/filters' << + '--exclude' << 'test' << + '--line-numbers' + + s.files = %w( README LICENSE ChangeLog Rakefile ) + Dir[File.join('{bin,lib}', '**', '*')] s.executables = [ 'nanoc' ] s.require_path = 'lib' s.bindir = 'bin' end Rake::GemPackageTask.new(spec) { |task| } task :install_gem do sh %{rake package} - sh %{sudo gem install pkg/#{NAME}-#{VERS}} + sh %{gem install pkg/#{NAME}-#{VERS}} end task :uninstall_gem do - sh %{sudo gem uninstall #{NAME}} + sh %{gem uninstall #{NAME}} end +### Documentation + +Rake::RDocTask.new do |task| + task.rdoc_files.include(spec.extra_rdoc_files + [ 'lib' ]) + task.rdoc_dir = 'rdoc' + task.options = spec.rdoc_options +end + ### Testing -Rake::TestTask.new(:test) do |test| - test.test_files = Dir['test/test_*.rb'] +task :rcov do + sh %{rcov test/**/test_*.rb -I test -x /Library} +end + +Rake::TestTask.new(:test) do |task| + ENV['QUIET'] = 'true' + + task.libs = [ 'lib', 'test' ] + task.test_files = Dir[ 'test/**/test_*.rb' ] end task :default => [ :test ]