lib/hoe.rb in hoe-2.14.0 vs lib/hoe.rb in hoe-2.15.0
- old
+ new
@@ -66,15 +66,17 @@
class Hoe
include Rake::DSL if defined?(Rake::DSL)
# duh
- VERSION = '2.14.0'
+ VERSION = '2.15.0'
@@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
:publish, :rcov, :gemcutter, :signing, :test]
+ @bad_plugins = []
+
##
# Used to add extra flags to RUBY_FLAGS.
RUBY_DEBUG = ENV['RUBY_DEBUG']
@@ -242,10 +244,17 @@
s = File::PATH_SEPARATOR
RUBY_FLAGS.sub!(/-I/, "-I#{dirs.join(s)}#{s}")
end
##
+ # Returns plugins that could not be loaded by Hoe.load_plugins.
+
+ def self.bad_plugins
+ @bad_plugins
+ end
+
+ ##
# Find and load all plugin files.
#
# It is called at the end of hoe.rb
def self.load_plugins plugins = Hoe.plugins
@@ -271,10 +280,13 @@
bad_plugins = plugins - @loaded.keys
bad_plugins.each do |bad_plugin|
plugins.delete bad_plugin
end
+ @bad_plugins.concat bad_plugins
+ @bad_plugins.uniq!
+
return @loaded, @found
end
##
# Normalize a project name into the project, file, and klass names that
@@ -500,9 +512,18 @@
# Convenience method to set add to both the author and email fields.
def developer name, email
self.author << name
self.email << email
+ end
+
+ ##
+ # Returns true if the gem +name+ is installed.
+
+ def have_gem? name
+ Gem::Specification.find_by_name name
+ rescue Gem::LoadError
+ false
end
##
# Create a newly initialized hoe spec. If a block is given, yield on
# it and finish post_initialize steps. This is deprecated behavior