Rakefile in alias-0.2.1 vs Rakefile in alias-0.2.2

- old
+ new

@@ -1,50 +1,35 @@ require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' -begin - require 'rcov/rcovtask' +require 'fileutils' - Rcov::RcovTask.new do |t| - t.libs << 'test' - t.test_files = FileList['test/**/*_test.rb'] - t.rcov_opts = ["-T -x '/Library/Ruby/*'"] - t.verbose = true - end -rescue LoadError - puts "Rcov not available. Install it for rcov-related tasks with: sudo gem install rcov" +def gemspec + @gemspec ||= eval(File.read('gemspec'), binding, 'gemspec') end -begin - require 'jeweler' - Jeweler::Tasks.new do |s| - s.name = "alias" - s.summary = "Creates, manages and saves aliases for class methods, instance methods, constants, delegated methods and more." - s.description = "Creates aliases for class methods, instance methods, constants, delegated methods and more. Aliases can be easily searched or saved as YAML config files to load later. Custom alias types are easy to create with the DSL Alias provides. Although Alias was created with the irb user in mind, any Ruby console program can hook into Alias for creating configurable aliases." - s.email = "gabriel.horner@gmail.com" - s.homepage = "http://tagaholic.me/alias/" - s.authors = ["Gabriel Horner"] - s.rubyforge_project = 'tagaholic' - s.has_rdoc = true - s.extra_rdoc_files = ["README.rdoc", "LICENSE.txt"] - s.files = FileList["Rakefile", "VERSION.yml", "README.rdoc", "CHANGELOG.rdoc", "LICENSE.txt", "{lib,test}/**/*"] - end +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 -rescue LoadError - puts "Jeweler not available. Install it for jeweler-related tasks with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" +desc "Install the gem locally" +task :install => :gem do + sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}} end -Rake::TestTask.new do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = false +desc "Generate the gemspec" +task :generate do + puts gemspec.to_ruby end -Rake::RDocTask.new do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'test' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README*') - rdoc.rdoc_files.include('lib/**/*.rb') +desc "Validate the gemspec" +task :gemspec do + gemspec.validate end -task :default => :test +desc 'Run tests' +task :test do |t| + sh 'bacon -q -Ilib -I. test/*_test.rb' +end + +task :default => :test \ No newline at end of file