require 'rake' require 'rake/rdoctask' require 'fileutils' def gemspec @gemspec ||= eval(File.read('irbtools.gemspec'), binding, 'irbtools.gemspec') end desc "Build the gem" task :gem => :gemspec do sh "gem build irbtools.gemspec" FileUtils.mkdir_p 'pkg' FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", 'pkg' end desc "Install the gem locally (without docs)" 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 Rake::RDocTask.new do |rdoc| version = File.exist?('VERSION') ? File.read('VERSION').chomp : "" rdoc.rdoc_dir = 'doc' rdoc.title = "irbtools #{version}" rdoc.rdoc_files.include('README*') rdoc.rdoc_files.include('lib/**/*.rb') end