lib/hoe.rb in hoe-1.2.1 vs lib/hoe.rb in hoe-1.2.2

- old
+ new

@@ -31,35 +31,47 @@ # # # add other tasks here # # === Tasks Provided: # -# * announce - Generate email announcement file and post to rubyforge. -# * audit - Run ZenTest against the package -# * check_manifest - Verify the manifest -# * clean - Clean up all the extras -# * config_hoe - Create a fresh ~/.hoerc file -# * debug_gem - Show information about the gem. -# * default - Run the default tasks -# * docs - Build the docs HTML Files -# * email - Generate email announcement file. -# * gem - Build the gem file only. -# * install - Install the package. Uses PREFIX and RUBYLIB -# * install_gem - Install the package as a gem -# * multi - Run the test suite using multiruby -# * package - Build all the packages -# * post_blog - Post announcement to blog. -# * post_news - Post announcement to rubyforge. -# * publish_docs - Publish RDoc to RubyForge -# * release - Package and upload the release to rubyforge. -# * ridocs - Generate ri locally for testing -# * test - Run the test suite. Use FILTER to add to the command line. -# * test_deps - Show which test files fail when run alone. -# * uninstall - Uninstall the package. +# announce:: Generate email announcement file and post to rubyforge. +# audit:: Run ZenTest against the package +# check_manifest:: Verify the manifest +# clean:: Clean up all the extras +# config_hoe:: Create a fresh ~/.hoerc file +# debug_gem:: Show information about the gem. +# default:: Run the default tasks +# docs:: Build the docs HTML Files +# email:: Generate email announcement file. +# gem:: Build the gem file only. +# install:: Install the package. Uses PREFIX and RUBYLIB +# install_gem:: Install the package as a gem +# multi:: Run the test suite using multiruby +# package:: Build all the packages +# post_blog:: Post announcement to blog. +# post_news:: Post announcement to rubyforge. +# publish_docs:: Publish RDoc to RubyForge +# release:: Package and upload the release to rubyforge. +# ridocs:: Generate ri locally for testing +# test:: Run the test suite. Use FILTER to add to the command line. +# test_deps:: Show which test files fail when run alone. +# uninstall:: Uninstall the package. # +# === Extra Configuration Options: +# +# Run +config_hoe+ to generate a new ~/.hoerc file. The file is a +# YAML formatted config file with the following settings: +# +# exclude:: A regular expression of files to exclude from +# +check_manifest+. +# publish_on_announce:: Run +publish_docs+ when you run +release+. +# blogs:: An array of hashes of blog settings. +# +# Run +config_hoe+ and see ~/.hoerc for examples. +# class Hoe - VERSION = '1.2.1' + VERSION = '1.2.2' ruby_prefix = Config::CONFIG['prefix'] sitelibdir = Config::CONFIG['sitelibdir'] ## @@ -364,11 +376,11 @@ end end desc 'Install the package as a gem' task :install_gem => [:clean, :package] do - sh "sudo gem install pkg/*.gem" + sh "#{'sudo ' unless WINDOZE}gem install pkg/*.gem" end desc 'Uninstall the package.' task :uninstall do Dir.chdir RUBYLIB do @@ -484,10 +496,11 @@ desc 'Create a fresh ~/.hoerc file' task :config_hoe do with_config(:create) do |rc, path| blog = { + "exclude" => /tmp$|CVS|\.svn/, "publish_on_announce" => false, "blogs" => [ { "user" => "user", "url" => "url", "extra_headers" => { @@ -567,18 +580,21 @@ desc "Verify the manifest" task :check_manifest => :clean do f = "Manifest.tmp" require 'find' files = [] - Find.find '.' do |path| - next unless File.file? path - next if path =~ /\.svn|tmp$|CVS/ - files << path[2..-1] + with_config do |config, _| + exclusions = config["exclude"] || /tmp$|CVS|\.svn/ + Find.find '.' do |path| + next unless File.file? path + next if path =~ exclusions + files << path[2..-1] + end + files = files.sort.join "\n" + File.open f, 'w' do |fp| fp.puts files end + system "#{DIFF} -du Manifest.txt #{f}" + rm f end - files = files.sort.join "\n" - File.open f, 'w' do |fp| fp.puts files end - system "#{DIFF} -du Manifest.txt #{f}" - rm f end end # end define def announcement # :nodoc: