lib/hoe.rb in hoe-2.4.0 vs lib/hoe.rb in hoe-2.5.0

- old
+ new

@@ -56,11 +56,11 @@ # end # end class Hoe # duh - VERSION = '2.4.0' + VERSION = '2.5.0' @@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package, :publish, :rcov, :rubyforge, :gemcutter, :signing, :test] ## @@ -95,16 +95,20 @@ # Use the #developer method to fill in both author and email cleanly. attr_accessor :author ## - # Optional: A description of the release's latest changes. Auto-populates. + # Optional: A description of the release's latest changes. + # Auto-populates to the top entry of History.txt. attr_accessor :changes ## - # Optional: A description of the project. Auto-populates. + # Optional: A description of the project. Auto-populates from the + # first paragraph of the DESCRIPTION section of README.txt. + # + # See also: Hoe#summary and Hoe.paragraphs_of. attr_accessor :description ## # Optional: What sections from the readme to use for @@ -178,11 +182,14 @@ # (tho, see #pluggable! if that's all you want to do) attr_accessor :spec_extras ## - # Optional: A short summary of the project. Auto-populates. + # Optional: A short summary of the project. Auto-populates from the + # first sentence of the description. + # + # See also: Hoe#description and Hoe.paragraphs_of. attr_accessor :summary ## # Optional: Number of sentences from description for summary. Defaults to 1. @@ -193,11 +200,13 @@ # Optional: An array of test file patterns [default: test/**/test_*.rb] attr_accessor :test_globs ## - # Optional: The url(s) of the project. (can be array). Auto-populates. + # Optional: The url(s) of the project. (can be array). + # Auto-populates to a list of urls read from the beginning of + # README.txt. attr_accessor :url ## # *MANDATORY*: The version. Don't hardcode! use a constant in the project. @@ -265,11 +274,17 @@ def self.plugins @@plugins end ## - # Create a new hoe-specification executing the supplied block + # Execute the Hoe DSL to define your project's Hoe specification + # (which interally creates a gem specification). All hoe attributes + # and methods are available within +block+. Eg: + # + # Hoe.spec name do + # # ... project specific data ... + # end def self.spec name, &block Hoe.load_plugins spec = self.new name @@ -301,24 +316,27 @@ ## # Add standard and user defined dependencies to the spec. def add_dependencies - hoe_deps = { - 'rake' => ">= #{RAKEVERSION}", - 'rubyforge' => ">= #{::RubyForge::VERSION}", # TODO: push down - } - self.extra_deps = normalize_deps extra_deps self.extra_dev_deps = normalize_deps extra_dev_deps - if name == 'hoe' then - hoe_deps.each do |pkg, vers| - extra_deps << [pkg, vers] - end + case name + when 'hoe' then + extra_deps << ['rake', ">= #{RAKEVERSION}"] + when 'rubyforge', 'rake', 'gemcutter' then + # avoid circular dependencies for hoe's (potentially) hoe'd dependencies else - extra_dev_deps << ['hoe', ">= #{VERSION}"] unless hoe_deps.has_key? name + extra_dev_deps << ['hoe', ">= #{VERSION}"] end + end + + ## + # Returns the proper dependency list for the thingy. + + def dependency_target + self.name == 'hoe' ? extra_deps : extra_dev_deps end ## # Define the Gem::Specification.