Rakefile in irbtools-more-0.3.1 vs Rakefile in irbtools-more-0.3.2

- old
+ new

@@ -1,30 +1,37 @@ -require 'rubygems' require 'rake' +require 'fileutils' +GEMSPEC = 'irbtools-more.gemspec' -begin - require 'jeweler' - Jeweler::Tasks.new do |gem| - gem.name = "irbtools-more" - gem.summary = %Q{irbtools is a meta gem which installs some useful irb gems and configures your irb. irbtools-more adds some gems which may not build out-of-the-box.} - gem.description = %Q{irbtools is a meta gem which installs some useful irb gems and configures your irb. irbtools-more adds some gems which may not build out-of-the-box. Simply put a require 'irbtools-more' in the .irbrc file in your home directory} - gem.email = "mail@janlelis.de" - gem.homepage = "http://github.com/janlelis/irbtools-more" - gem.authors = ["Jan Lelis"] - gem.add_dependency 'irbtools', '>= 0.8.0' - gem.add_dependency 'drx' - gem.add_dependency 'bond' - end - Jeweler::GemcutterTasks.new -rescue LoadError - puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler" + +def gemspec + @gemspec ||= eval(File.read(GEMSPEC), binding, GEMSPEC) end -require 'rake/rdoctask' -Rake::RDocTask.new do |rdoc| - version = File.exist?('VERSION') ? File.read('VERSION').chomp : "" +desc "Build the gem" +task :gem => :gemspec do + sh "gem build " + GEMSPEC + FileUtils.mkdir_p 'pkg' + FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", 'pkg' +end - rdoc.rdoc_dir = 'doc' - rdoc.title = "irbtools-more #{version}" - rdoc.rdoc_files.include('README*') - rdoc.rdoc_files.include('lib/**/*.rb') +desc "Install the gem locally" +task :install => :gem do + sh %{gem install pkg/#{gemspec.name}-#{gemspec.version} --no-rdoc --no-ri} end + +desc "Generate the gemspec" +task :generate do + puts gemspec.to_ruby +end + +desc "Validate the gemspec" +task :gemspec do + gemspec.validate +end + +desc 'Run tests' +task :test do |t| + sh 'bacon -q -Ilib -I. test/*_test.rb' +end + +task :default => :test