lib/hoe.rb in hoe-1.0.0 vs lib/hoe.rb in hoe-1.0.1

- old
+ new

@@ -7,11 +7,11 @@ require 'rake/rdoctask' require 'rake/testtask' require 'rbconfig' class Hoe - VERSION = '1.0.0' + VERSION = '1.0.1' rubyprefix = Config::CONFIG['prefix'] sitelibdir = Config::CONFIG['sitelibdir'] PREFIX = ENV['PREFIX'] || rubyprefix @@ -24,11 +24,11 @@ RUBY_FLAGS = ENV['RUBY_FLAGS'] || "-w -I#{%w(lib bin ../../RubyInline/dev).join(File::PATH_SEPARATOR)}" + (RUBY_DEBUG ? " #{RUBY_DEBUG}" : '') FILTER = ENV['FILTER'] # for tests (eg FILTER="-n test_blah") - attr_accessor :author, :bin_files, :clean_globs, :email, :lib_files, :name, :rubyforge_name, :spec, :summary, :test_files, :url, :version + attr_accessor :author, :bin_files, :clean_globs, :description, :email, :extra_deps, :lib_files, :name, :rubyforge_name, :spec, :summary, :test_files, :url, :version def initialize(name, version) self.name = name self.version = version @@ -36,11 +36,14 @@ self.rubyforge_name = name.downcase self.url = "http://www.zenspider.com/ZSS/Products/#{name}/" self.author = "Ryan Davis" self.email = "ryand-ruby@zenspider.com" self.clean_globs = %w(diff diff.txt demo.rb *.gem **/*~) - + self.description = "#{author} is too lazy to write a description" + self.summary = "#{author} is too lazy to write a summary" + self.extra_deps = [name == 'hoe' ? 'rake' : 'hoe'] + yield self if block_given? define_tasks end @@ -68,34 +71,25 @@ s.author = author s.email = email s.homepage = url s.rubyforge_project = rubyforge_name - paragraphs = File.read("README.txt").split(/\n\n+/) - s.description = paragraphs[2] + s.description = description - s.add_dependency('RubyInline', '>= 3.2.0') + extra_deps.each do |dep| + s.add_dependency(*dep) + end + s.files = File.read("Manifest.txt").split s.executables = s.files.grep(/bin/) { |f| File.basename(f) } s.bindir = "bin" s.require_paths = ['lib', 'test'] s.has_rdoc = true s.test_suite_file = "test/test_all.rb" if test ?f, "test/test_all.rb" - if $DEBUG then - puts "Gem Info:" - puts - puts "Summary = #{s.summary}" - puts - puts "Description = #{s.description}" - puts - puts "Executables = #{s.executables.join(", ")}" - puts - puts "Files = #{s.files.join(", ")}" - puts - end + puts s.to_ruby if $DEBUG end self.lib_files = spec.files.grep(/^lib/) self.bin_files = spec.files.grep(/^bin/) self.test_files = %w(test/test_sexp_processor.rb) # for ruby_to_c's tests. @@ -134,17 +128,17 @@ puts "Releasing #{name} v. #{version}" require 'rubyforge' pkg = "pkg/#{name}-#{version}" if $DEBUG then - puts "release_id = rf.add_release #{rubyforge_name.inspect}, #{name.inspect}, #{version.inspect}, \"#{pkg}.gem\"" - puts "rf.add_file #{rubyforge_name.inspect}, #{name.inspect}, release_id, \"#{pkg}.tgz\"" - else - rf = RubyForge.new - rf.login - release_id = rf.add_release rubyforge_name, name, version, "#{pkg}.gem" - rf.add_file rubyforge_name, name, release_id, "#{pkg}.tgz" + puts "release_id = rf.add_release #{rubyforge_name.inspect}, #{name.inspect}, #{version.inspect}, \"#{pkg}.tgz\"" + puts "rf.add_file #{rubyforge_name.inspect}, #{name.inspect}, release_id, \"#{pkg}.gem\"" end + + rf = RubyForge.new + rf.login + release_id = rf.add_release rubyforge_name, name, version, "#{pkg}.tgz" + rf.add_file rubyforge_name, name, release_id, "#{pkg}.gem" end ############################################################ # Doco