Rakefile in tarantula-0.3.3 vs Rakefile in tarantula-0.4.0

- old
+ new

@@ -1,72 +1,40 @@ require 'rake' require 'rake/testtask' require 'rake/rdoctask' -require 'micronaut' -require 'micronaut/rake_task' begin - require 'jeweler' - files = ["CHANGELOG", "MIT-LICENSE", "Rakefile", "README.rdoc", "VERSION.yml"] - files << Dir["examples/**/*", "laf/**/*", "lib/**/*", "tasks/**/*", "template/**/*"] - - Jeweler::Tasks.new do |s| - s.name = "tarantula" - s.summary = "A big hairy fuzzy spider that crawls your site, wreaking havoc" - s.description = "A big hairy fuzzy spider that crawls your site, wreaking havoc" - s.homepage = "http://github.com/relevance/tarantula" - s.email = "opensource@thinkrelevance.com" - s.authors = ["Relevance, Inc."] - s.require_paths = ["lib"] - s.files = files.flatten - s.add_dependency 'htmlentities' - s.add_dependency 'hpricot' - s.rubyforge_project = 'thinkrelevance' + require 'rspec' + require 'rspec/core/rake_task' + + RSpec::Core::RakeTask.new('spec') do |t| + t.verbose = true end -rescue LoadError - puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" -end -desc 'Generate documentation for the tarantula plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'Tarantula' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README.rdoc') - rdoc.rdoc_files.include('lib/**/*.rb') -end - -desc "Run all micronaut examples" -Micronaut::RakeTask.new :examples do |t| - t.pattern = "examples/**/*_example.rb" -end - -namespace :examples do - desc "Run all micronaut examples using rcov" - Micronaut::RakeTask.new :coverage do |t| - t.pattern = "examples/**/*_example.rb" + desc "Run all RSpec specs using rcov" + RSpec::Core::RakeTask.new :rcov do |t| + t.pattern = File.dirname(__FILE__)+"/spec/**/*_spec.rb" t.rcov = true t.rcov_opts = %[--exclude "gems/*,/Library/Ruby/*,config/*" --text-summary --sort coverage] end - - RAILS_VERSIONS = %w[2.3.2 2.3.4] - - unless RUBY_VERSION =~ /^1\.9\./ - RAILS_VERSIONS.unshift(*%w[2.0.2 2.1.0 2.1.1 2.2.2 2.3.3]) - RAILS_VERSIONS.sort! - end - - desc "Run examples with multiple versions of rails" - task :multi_rails do - RAILS_VERSIONS.each do |rails_version| - puts - sh "RAILS_VERSION='#{rails_version}' rake examples" - end - end - + + task :default => :spec +rescue LoadError + puts "rspec, or one of its dependencies, is not available. Install it with: sudo gem install rspec" end -if ENV["RUN_CODE_RUN"] - task :default => "examples:multi_rails" -else - task :default => "examples" +begin + %w{sdoc sdoc-helpers rdiscount}.each { |name| gem name } + require 'sdoc_helpers' +rescue LoadError => ex + puts "sdoc support not enabled:" + puts ex.inspect +end + +require 'rake/rdoctask' +Rake::RDocTask.new do |rdoc| + version = File.exist?('VERSION') ? File.read('VERSION') : '' + rdoc.rdoc_dir = 'rdoc' + rdoc.title = "tarantula #{version}" + rdoc.rdoc_files.include('README*') + rdoc.rdoc_files.include('lib/**/*.rb') end