Rakefile in simply_useful-0.1.6 vs Rakefile in simply_useful-0.2.0

- old
+ new

@@ -1,72 +1,52 @@ -require 'rake' -require 'rubygems' +# encoding: utf-8 -# Gem building +require 'rubygems' +require 'bundler' begin - require 'jeweler' - Jeweler::Tasks.new do |s| - s.name = "simply_useful" - s.summary = "A set of simply useful classes" - s.email = "maciej@inszy.org" - s.homepage = "http://github.com/maciej/simply_useful" - s.description = "A set of simply useful classes. Contains extensions to core Ruby classes." - s.authors = ["Maciej Bilas"] - s.rubyforge_project = %q{simply_useful} - end -rescue LoadError - puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" + Bundler.setup(:default, :development) +rescue Bundler::BundlerError => e + $stderr.puts e.message + $stderr.puts "Run `bundle install` to install missing gems" + exit e.status_code end +require 'rake' -# Specs -begin - require 'spec' -rescue LoadError - require 'spec' + +# Gem building +require 'jeweler' +Jeweler::Tasks.new do |gem| + gem.name = "simply_useful" + gem.summary = "A set of simply useful classes" + gem.license = "MIT" + gem.email = "maciej.bilas@gmail.com" + gem.homepage = "http://github.com/maciej/simply_useful" + gem.description = "A set of simply useful classes. Contains extensions to core Ruby classes." + gem.authors = ["Maciej Bilas"] + gem.rubyforge_project = %q{simply_useful} + # dependencies defined in Gemfile end -begin - require 'spec/rake/spectask' -rescue LoadError - puts <<-EOS - To use rspec for testing you must install rspec gem: - gem install rspec - EOS - exit(0) -end +Jeweler::RubygemsDotOrgTasks.new -desc "Run the specs under spec/models" -Spec::Rake::SpecTask.new do |t| - t.spec_opts = ['--options', "spec/spec.opts"] - t.spec_files = FileList['spec/**/*_spec.rb'] +require 'rspec/core' +require 'rspec/core/rake_task' +RSpec::Core::RakeTask.new(:spec) do |spec| + spec.pattern = FileList['spec/**/*_spec.rb'] end -# Coverage -begin - require 'rcov/rcovtask' - Rcov::RcovTask.new do |t| - t.libs << 'test' - t.test_files = FileList['test/**/*_test.rb'] - t.verbose = true - end -rescue LoadError - puts "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov" +desc "Run RSpec with code coverage" +task :coverage do |spec| + ENV['COVERAGE'] = "true" + Rake::Task["spec"].execute end -# RDoc -require 'rake/rdoctask' +require 'rdoc/task' Rake::RDocTask.new do |rdoc| + version = File.exist?('VERSION') ? File.read('VERSION') : "" + rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'the-perfect-gemx' - rdoc.options << '--line-numbers' << '--inline-source' + rdoc.title = "simply_useful #{version}" rdoc.rdoc_files.include('README*') rdoc.rdoc_files.include('lib/**/*.rb') -end - -# Cucumber -begin - require 'cucumber/rake/task' - Cucumber::Rake::Task.new(:features) -rescue LoadError - puts "Cucumber is not available. In order to run features, you must: sudo gem install cucumber" end task :default => :spec