Rakefile in attribute_predicates-0.2.0 vs Rakefile in attribute_predicates-0.2.1

- old
+ new

@@ -1,15 +1,17 @@ +require 'rubygems' +require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'rake/gempackagetask' -require 'rake/contrib/sshpublisher' spec = Gem::Specification.new do |s| s.name = 'attribute_predicates' - s.version = '0.2.0' + s.version = '0.2.1' s.platform = Gem::Platform::RUBY - s.summary = 'Adds automatic generation of predicate methods for attributes.' + s.summary = 'Adds automatic generation of predicate methods for attributes' + s.description = s.summary s.files = FileList['{lib,test}/**/*'] + %w(CHANGELOG.rdoc init.rb LICENSE Rakefile README.rdoc) s.require_path = 'lib' s.has_rdoc = true s.test_files = Dir['test/**/*_test.rb'] @@ -47,42 +49,42 @@ desc "Generate documentation for the #{spec.name} plugin." Rake::RDocTask.new(:rdoc) do |rdoc| rdoc.rdoc_dir = 'rdoc' rdoc.title = spec.name rdoc.template = '../rdoc_template.rb' - rdoc.options << '--line-numbers' + rdoc.options << '--line-numbers' << '--inline-source' rdoc.rdoc_files.include('README.rdoc', 'CHANGELOG.rdoc', 'LICENSE', 'lib/**/*.rb') end - + +desc 'Generate a gemspec file.' +task :gemspec do + File.open("#{spec.name}.gemspec", 'w') do |f| + f.write spec.to_ruby + end +end + Rake::GemPackageTask.new(spec) do |p| p.gem_spec = spec - p.need_tar = true - p.need_zip = true end desc 'Publish the beta gem.' task :pgem => [:package] do + require 'rake/contrib/sshpublisher' Rake::SshFilePublisher.new('aaron@pluginaweek.org', '/home/aaron/gems.pluginaweek.org/public/gems', 'pkg', "#{spec.name}-#{spec.version}.gem").upload end desc 'Publish the API documentation.' task :pdoc => [:rdoc] do + require 'rake/contrib/sshpublisher' Rake::SshDirPublisher.new('aaron@pluginaweek.org', "/home/aaron/api.pluginaweek.org/public/#{spec.name}", 'rdoc').upload end desc 'Publish the API docs and gem' task :publish => [:pgem, :pdoc, :release] desc 'Publish the release files to RubyForge.' task :release => [:gem, :package] do - require 'rubyforge' + require 'rake/gemcutter' - ruby_forge = RubyForge.new.configure - ruby_forge.login - - %w(gem tgz zip).each do |ext| - file = "pkg/#{spec.name}-#{spec.version}.#{ext}" - puts "Releasing #{File.basename(file)}..." - - ruby_forge.add_release(spec.rubyforge_project, spec.name, spec.version, file) - end + Rake::Gemcutter::Tasks.new(spec) + Rake::Task['gem:push'].invoke end