Rakefile in rufus-verbs-1.0.0 vs Rakefile in rufus-verbs-1.0.1

- old
+ new

@@ -1,80 +1,87 @@ +$:.unshift('.') # 1.9.2 -require 'lib/rufus/verbs/version.rb' - require 'rubygems' +require 'rubygems/user_interaction' if Gem::RubyGemsVersion == '1.5.0' + require 'rake' +require 'rake/clean' +#require 'rake/rdoctask' +require 'rdoc/task' # -# CLEAN +# clean -require 'rake/clean' -CLEAN.include('pkg', 'tmp', 'html') -task :default => [ :clean ] +CLEAN.include('pkg', 'rdoc') # -# GEM +# test / spec -require 'jeweler' +#task :spec => :check_dependencies do +task :spec do + exec 'rspec spec/' +end +task :test => :spec -Jeweler::Tasks.new do |gem| +task :default => :spec - gem.version = Rufus::Verbs::VERSION - gem.name = 'rufus-verbs' - gem.summary = 'GET, POST, PUT, DELETE, with something around' - gem.description = %{ -GET, POST, PUT, DELETE, with something around. +# +# gem -An HTTP client Ruby gem, with conditional GET, basic auth, and more. - } - gem.email = 'jmettraux@gmail.com' - gem.homepage = 'http://github.com/jmettraux/rufus-verbs/' - gem.authors = [ 'John Mettraux' ] - gem.rubyforge_project = 'rufus' +GEMSPEC_FILE = Dir['*.gemspec'].first +GEMSPEC = eval(File.read(GEMSPEC_FILE)) +GEMSPEC.validate - gem.test_file = 'test/test.rb' - gem.add_dependency 'rufus-lru' - gem.add_development_dependency 'yard', '>= 0' +desc %{ + builds the gem and places it in pkg/ +} +task :build do - # gemspec spec : http://www.rubygems.org/read/chapter/20 + sh "gem build #{GEMSPEC_FILE}" + sh "mkdir pkg" rescue nil + sh "mv #{GEMSPEC.name}-#{GEMSPEC.version}.gem pkg/" end -Jeweler::GemcutterTasks.new +desc %{ + builds the gem and pushes it to rubygems.org +} +task :push => :build do -# -# DOC + sh "gem push pkg/#{GEMSPEC.name}-#{GEMSPEC.version}.gem" +end -begin - require 'yard' +# +# rdoc +# +# make sure to have rdoc 2.5.x to run that - YARD::Rake::YardocTask.new do |doc| - doc.options = [ - '-o', 'html/rufus-verbs', '--title', - "rufus-verbs #{Rufus::Verbs::VERSION}" - ] - end +Rake::RDocTask.new do |rd| -rescue LoadError + rd.main = 'README.txt' + rd.rdoc_dir = "rdoc/#{GEMSPEC.name}" - task :yard do - abort "YARD is not available : sudo gem install yard" - end + rd.rdoc_files.include('README.rdoc', 'CHANGELOG.txt', 'lib/**/*.rb') + + rd.title = "#{GEMSPEC.name} #{GEMSPEC.version}" end # -# TO THE WEB +# upload_rdoc -task :upload_website => [ :clean, :yard ] do +desc %{ + upload the rdoc to rubyforge +} +task :upload_rdoc => [ :clean, :rdoc ] do account = 'jmettraux@rubyforge.org' webdir = '/var/www/gforge-projects/rufus' - sh "rsync -azv -e ssh html/rufus-verbs #{account}:#{webdir}/" + sh "rsync -azv -e ssh rdoc/#{GEMSPEC.name} #{account}:#{webdir}/" end