Rakefile in nanoc-2.1.6 vs Rakefile in nanoc-2.2
- old
+ new
@@ -1,16 +1,14 @@
##### Requirements
# Rake etc
require 'rake'
-require 'rake/clean'
require 'rake/gempackagetask'
-require 'rake/testtask'
-require 'rake/rdoctask'
# nanoc itself
-require File.dirname(__FILE__) + '/lib/nanoc.rb'
+$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/lib'))
+require 'nanoc'
##### Test Ruby 1.9
if RUBY_VERSION >= '1.9'
# Check presence of vendor/mocha
@@ -31,35 +29,25 @@
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:
+Thanks for installing nanoc 2.2! 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.
+Be sure to check out the nanoc blog at <http://nanoc.stoneship.org/blog/> for
+details about this release.
Enjoy!
EOS
-##### Cleaning
-
-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|
+GemSpec = Gem::Specification.new do |s|
s.name = NAME
s.version = VERS
s.platform = Gem::Platform::RUBY
s.summary = SUMMARY
s.description = s.summary
@@ -86,44 +74,14 @@
'--exclude' << 'doc' <<
'--exclude' << 'test' <<
'--exclude' << 'vendor' <<
'--line-numbers'
- s.files = %w( README LICENSE ChangeLog Rakefile ) + Dir[File.join('{bin,lib}', '**', '*')]
+ s.files = %w( README LICENSE ChangeLog Rakefile ) + Dir[File.join('{bin,lib,vendor}', '**', '*')]
s.executables = [ 'nanoc' ]
s.require_path = 'lib'
s.bindir = 'bin'
end
-Rake::GemPackageTask.new(spec) { |task| }
+Dir.glob('tasks/**/*.rake').each { |r| Rake.application.add_import r }
-task :install_gem do
- sh %{rake package}
- sh %{gem install pkg/#{NAME}-#{VERS}}
-end
-
-task :uninstall_gem do
- 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
-
-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 ]
+task :default => [ :fetch_dependencies, :test ]