Rakefile in cucumber-nagios-0.8.11 vs Rakefile in cucumber-nagios-0.9.0

- old
+ new

@@ -1,81 +1,53 @@ #!/usr/bin/env ruby -require 'rubygems' -require 'rake' -require 'lib/cucumber/nagios/version' - begin - require 'jeweler' - Jeweler::Tasks.new do |gem| - gem.name = "cucumber-nagios" - gem.summary = "Systems testing plugin for Nagios using Cucumber/Webrat/Mechanize/net-ssh." - gem.description = "cucumber-nagios helps you write high-level behavioural tests for your web applications and Unix infrastructure that can be plugged into Nagios." - gem.email = "lindsay@holmwood.id.au" - gem.homepage = "http://cucumber-nagios.org/" - gem.authors = ["Lindsay Holmwood"] - gem.has_rdoc = false - gem.version = Cucumber::Nagios::VERSION - - gem.add_dependency('cucumber', '>= 0.10.0') - gem.add_dependency('rspec', '>= 2.3.0') - gem.add_dependency('webrat', '= 0.7.2') - gem.add_dependency('mechanize', '= 1.0.0') - gem.add_dependency('templater', '>= 1.0.0') - gem.add_dependency('net-ssh', '= 2.0.18') - gem.add_dependency('amqp', '= 0.6.7') - gem.add_dependency('bundler', '= 1.0.7') - - gem.add_development_dependency('rake', '>= 0.8.3') - - gem.bindir = "bin" - gem.executables = %w(cucumber-nagios-gen cucumber-nagios) - end - Jeweler::GemcutterTasks.new + require 'bundler' + Bundler::GemHelper.install_tasks rescue LoadError - puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" + puts "Bundler not available. Install it with: gem install bundler" end -require 'rake/testtask' -Rake::TestTask.new(:test) do |test| - test.libs << 'lib' << 'test' - test.pattern = 'test/**/test_*.rb' - test.verbose = true -end - begin - require 'rcov/rcovtask' - Rcov::RcovTask.new do |test| - test.libs << 'test' - test.pattern = 'test/**/test_*.rb' - test.verbose = true - end -rescue LoadError - task :rcov do - abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov" - end -end - -task :test => :check_dependencies - -begin require 'cucumber/rake/task' - Cucumber::Rake::Task.new(:features) - - task :features => :check_dependencies + #Cucumber::Rake::Task.new(:features) rescue LoadError task :features do abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber" end end -task :default => :test +task :default => :features +desc "Run Cucumber features" +task :features do + puts "The bundled Cucumber Rake task is broken with Bundler." + puts "Invoking Cucumber manually." + puts + system("cucumber") +end + require 'rake/rdoctask' Rake::RDocTask.new do |rdoc| version = File.exist?('VERSION') ? File.read('VERSION') : "" rdoc.rdoc_dir = 'rdoc' rdoc.title = "cucumber-nagios #{version}" rdoc.rdoc_files.include('README*') rdoc.rdoc_files.include('lib/**/*.rb') end + + +require "rake/clean" +file 'MANIFEST.tmp' do + # generate manifest from everything checked into git + # this allows us to ignore things using .gitignore + sh %{git ls-files > MANIFEST.tmp} +end +CLEAN << 'MANIFEST.tmp' + +desc "Check the manifest against current files" +task :check_manifest => [:clean, 'MANIFEST', 'MANIFEST.tmp'] do + puts `diff -du MANIFEST MANIFEST.tmp` +end + +CLEAN << '*.gem'