lib/hoe.rb in hoe-3.0.8 vs lib/hoe.rb in hoe-3.1.0
- old
+ new
@@ -89,11 +89,11 @@
class Hoe
include Rake::DSL if defined?(Rake::DSL)
# duh
- VERSION = '3.0.8'
+ VERSION = '3.1.0'
@@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
:publish, :gemcutter, :signing, :test]
@bad_plugins = []
@@ -181,10 +181,15 @@
# Optional: The filename for the project history. [default: History.txt]
attr_accessor :history_file
##
+ # Optional: An array containing the license(s) under which this gem is released.
+
+ attr_accessor :licenses
+
+ ##
# *MANDATORY*: The name of the release.
#
# Set via Hoe.spec.
attr_accessor :name
@@ -421,10 +426,18 @@
send msg if self.respond_to? msg
end
end
##
+ # Specify a license for your gem.
+ # Call it multiple times if you are releasing under multiple licenses.
+ #
+ def license name
+ self.licenses << name
+ end
+
+ ##
# Add a dependency declaration to your spec. Pass :dev to
# +type+ for developer dependencies.
def dependency name, version, type = :runtime
raise "Unknown dependency type: #{type}" unless
@@ -548,10 +561,12 @@
warn " add a version to your hoe spec,"
warn " or fix your Manifest.txt"
end
end
+ spec.licenses = licenses unless licenses.empty?
+
# Do any extra stuff the user wants
spec_extras.each do |msg, val|
case val
when Proc
val.call spec.send(msg)
@@ -591,9 +606,10 @@
self.description_sections = %w(description)
self.email = []
self.extra_deps = []
self.extra_dev_deps = []
self.extra_rdoc_files = []
+ self.licenses = []
self.post_install_message = nil
self.rubyforge_name = name.downcase
self.spec = nil
self.spec_extras = {}
self.summary = nil