Rakefile in melbourne-1.0.0 vs Rakefile in melbourne-1.0.1

- old
+ new

@@ -1,8 +1,14 @@ -require 'rake' -require 'rake/rdoctask' +require 'rubygems' +require 'bundler' + +Bundler.setup +Bundler.require + require 'spec/rake/spectask' +require 'simplabs/excellent/rake' +require 'rake/extensiontask' desc 'Default: run specs.' task :default => :spec desc 'Run the specs.' @@ -15,24 +21,21 @@ t.rcov_dir = 'doc/coverage' t.spec_files = FileList['spec/**/*_spec.rb'] end desc 'Generate documentation for the Melbourne gem.' -Rake::RDocTask.new(:rdoc) do |t| - t.rdoc_dir = 'doc' - t.title = 'Melbourne' - t.options << '--line-numbers' << '--inline-source' - t.rdoc_files.include('README.rdoc') - t.rdoc_files.include('lib/**/*.rb') +YARD::Rake::YardocTask.new(:doc) do |t| + t.files = ['lib/**/*.rb', '-', 'HISTORY.md'] + t.options = ['--no-private', '--title', 'Melbourne Documentation'] end -begin - require 'simplabs/excellent/rake' +desc 'compile the C extension' +Rake::ExtensionTask.new('melbourne') do |ext| + ext.lib_dir = File.join('lib', 'ext') +end +Rake::Task[:spec].prerequisites << :compile - desc 'Analyse the Melbourne source with Excellent.' - Simplabs::Excellent::Rake::ExcellentTask.new(:excellent) do |t| - t.html = 'doc/excellent.html' - t.paths = ['lib'] - end -rescue LoadError - puts "Install the excellent gem for source code analysis." +desc 'Analyse the Melbourne source with Excellent.' +Simplabs::Excellent::Rake::ExcellentTask.new(:excellent) do |t| + t.html = 'doc/excellent.html' + t.paths = ['lib'] end