Rakefile in gravatarify-2.1.0 vs Rakefile in gravatarify-2.2.1

- old
+ new

@@ -1,28 +1,33 @@ require 'rake' require 'rake/testtask' -require 'yard' -require File.join(File.dirname(__FILE__), 'lib', 'gravatarify') +$: << File.join(File.dirname(__FILE__), 'lib') +require 'gravatarify' + desc 'Default: run unit tests.' task :default => :test desc 'Test the gravatarify plugin.' Rake::TestTask.new(:test) do |t| - t.libs << 'lib' t.libs << 'test' t.pattern = 'test/**/*_test.rb' t.verbose = true end -desc 'Generate documentation for gravatarify. (requires yard)' -YARD::Rake::YardocTask.new(:doc) do |t| - t.files = ['lib/**/*.rb'] - t.options = [ - "--readme", "README.md", - "--title", "gravatarify (v#{Gravatarify::VERSION}) API Documentation" - ] +begin + require 'yard' + desc 'Generate documentation for gravatarify. (requires yard)' + YARD::Rake::YardocTask.new(:doc) do |t| + t.files = ['lib/**/*.rb'] + t.options = [ + "--readme", "README.md", + "--title", "gravatarify (v#{Gravatarify::VERSION}) API Documentation" + ] + end +rescue LoadError + puts "yard is required to build documentation: gem install yard" end begin require 'jeweler' Jeweler::Tasks.new do |gemspec| @@ -43,21 +48,23 @@ gemspec.extra_rdoc_files = %w{README.md} gemspec.add_development_dependency('shoulda', '>= 2.10.2') gemspec.add_development_dependency('rr', '>= 0.10.5') gemspec.add_development_dependency('activesupport', '>= 2.3.5') + + gemspec.files.reject! { |file| file =~ /\.gemspec$/ } end Jeweler::GemcutterTasks.new rescue LoadError puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" end desc 'Clean all generated files (.yardoc and doc/*)' task :clean do |t| FileUtils.rm_rf "doc" FileUtils.rm_rf "pkg" - FileUtils.rm_rf "gravatarify.gemspec" FileUtils.rm_rf ".yardoc" + Dir['**/*.rbc'].each { |f| File.unlink(f) } end namespace :metrics do desc 'Report all metrics, i.e. stats and code coverage.' task :all => [:stats, :coverage]