lib/hoe.rb in hoe-1.1.0 vs lib/hoe.rb in hoe-1.1.1

- old
+ new

@@ -77,11 +77,11 @@ # * RUBY_FLAGS - Used to specify flags to ruby [has smart default]. # * RUBY_DEBUG - Used to add extra flags to RUBY_FLAGS. # * FILTER - Used to add flags to test_unit (e.g., -n test_borked) class Hoe - VERSION = '1.1.0' + VERSION = '1.1.1' rubyprefix = Config::CONFIG['prefix'] sitelibdir = Config::CONFIG['sitelibdir'] PREFIX = ENV['PREFIX'] || rubyprefix @@ -169,11 +169,12 @@ s.files = File.read("Manifest.txt").split s.executables = s.files.grep(/bin/) { |f| File.basename(f) } s.bindir = "bin" - s.require_paths = Dir['{lib,test}'] + dirs = Dir['{lib,test}'] + s.require_paths = dirs unless dirs.empty? s.has_rdoc = true s.test_suite_file = "test/test_all.rb" if test ?f, "test/test_all.rb" end desc 'Show information about the gem.' @@ -305,28 +306,34 @@ end desc 'Generate email announcement file.' task :email do require 'rubyforge' - subject, body = announcement + subject, title, body, urls = announcement File.open("email.txt", "w") do |mail| - mail.puts subject + mail.puts "Subject: [ANN] #{subject}" mail.puts + mail.puts title + mail.puts + mail.puts urls + mail.puts mail.puts body + mail.puts + mail.puts urls end puts "Created email.txt" end desc 'Post announcement to rubyforge.' task :post_news do require 'rubyforge' - subject, body = announcement + subject, title, body, urls = announcement rf = RubyForge.new rf.login - rf.post_news(rubyforge_name, subject, body) + rf.post_news(rubyforge_name, subject, "#{title}\n\n#{body}") puts "Posted to rubyforge" end desc 'Generate email announcement file and post to rubyforge.' task :announce => [:email, :post_news] @@ -342,13 +349,14 @@ end # end define def announcement urls = " " + Array(url).map {|s| s.strip}.join("\n ") - subject = "Subject: #{name} #{version} Released" - body = "#{name} version #{version} has been released!\n\n#{urls}\n\n#{description}\n\nChanges:\n\n#{changes}\n\n#{urls}\n" + subject = "#{name} #{version} Released" + title = "#{name} version #{version} has been released!" + body = "#{description}\n\nChanges:\n\n#{changes}" - return subject, body + return subject, title, body, urls end def run_tests(multi=false) # :nodoc: msg = multi ? :sh : :ruby cmd = if test ?f, 'test/test_all.rb' then