lib/hoe.rb in hoe-1.5.3 vs lib/hoe.rb in hoe-1.6.0

- old
+ new

@@ -113,11 +113,11 @@ # This will set the +Gem::Specification+ platform to the one indicated in # +FORCE_PLATFORM+ (instead of default Gem::Platform::CURRENT) # class Hoe - VERSION = '1.5.3' + VERSION = '1.6.0' ruby_prefix = Config::CONFIG['prefix'] sitelibdir = Config::CONFIG['sitelibdir'] ## @@ -177,10 +177,15 @@ # Populated automatically from the manifest. List of executables. attr_accessor :bin_files # :nodoc: ## + # *Optional*: An array of the project's blog categories. Defaults to project name. + + attr_accessor :blog_categories + + ## # Optional: A description of the release's latest changes. Auto-populates. attr_accessor :changes ## @@ -305,10 +310,11 @@ # Defaults self.author = [] self.clean_globs = %w(diff diff.txt email.txt ri *.gem *~ **/*~ *.rbc **/*.rbc) self.description_sections = %w(description) + self.blog_categories = [name] self.email = [] self.extra_deps = [] self.multiruby_skip = [] self.need_tar = true self.need_zip = false @@ -535,11 +541,12 @@ pkg.need_zip = @need_zip end desc 'Install the package as a gem.' task :install_gem => [:clean, :package] do - sh "#{'sudo ' unless WINDOZE}gem install --local pkg/*.gem" + gem = Dir['pkg/*.gem'].first + sh "#{'sudo ' unless WINDOZE}gem install --local #{gem}" end desc 'Package and upload the release to rubyforge.' task :release => [:clean, :package] do |t| v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z" @@ -682,11 +689,13 @@ body += "\n\n#{urls}" config['blogs'].each do |site| server = XMLRPC::Client.new2(site['url']) content = site['extra_headers'].merge(:title => title, - :description => body) + :description => body, + :categories => blog_categories) + result = server.call('metaWeblog.newPost', site['blog_id'], site['user'], site['password'], content, @@ -781,14 +790,13 @@ end # end define def announcement # :nodoc: changes = self.changes.rdoc_to_markdown - subject = "#{name} #{version} Released" - title = "#{name} version #{version} has been released!" - body = "#{description}\n\nChanges:\n\n#{changes}".rdoc_to_markdown - urls = Array(url).map { |s| "* <#{s.strip.rdoc_to_markdown}>" }.join("\n") + title = "#{name} version #{version} has been released!" + body = "#{description}\n\nChanges:\n\n#{changes}".rdoc_to_markdown + urls = Array(url).map { |s| "* <#{s.strip.rdoc_to_markdown}>" }.join("\n") return subject, title, body, urls end def run_tests(multi=false) # :nodoc: