From ed1098d5f14f2d2e97b2ac85d839915bf4c88161 Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Sun, 11 Mar 2012 22:34:29 -0700 Subject: [PATCH] Warn is licenses is empty. Fixes #202 --- lib/rubygems/specification.rb | 10 ++++++---- test/rubygems/test_gem_commands_build_command.rb | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index d306a32edace..c86ce877faca 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -485,8 +485,8 @@ def extra_rdoc_files # # The license must be a short name, no more than 64 characters. # - # This should just be the name of your license, make to include the full - # text of the license inside of the gem when you build it. + # This should just be the name of your license. The full + # text of the license should be inside of the gem when you build it. # # Usage: # spec.license = 'MIT' @@ -500,8 +500,8 @@ def license=o # # Each license must be a short name, no more than 64 characters. # - # This should just be the name of your license, make to include the full - # text of the license inside of the gem when you build it. + # This should just be the name of your license. The full + # text of the license should be inside of the gem when you build it. # # Usage: # spec.licenses = ['MIT', 'GPL-2'] @@ -2386,6 +2386,8 @@ def validate packaging = true end } + alert_warning 'licenses is empty' if licenses.empty? + # reject lazy developers: # FIX: Doesn't this just evaluate to "FIXME" or "TODO"? diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb index 3c6a4485e915..6014b7eb3fb6 100644 --- a/test/rubygems/test_gem_commands_build_command.rb +++ b/test/rubygems/test_gem_commands_build_command.rb @@ -87,7 +87,7 @@ def util_test_build_gem(gem, gemspec_file) assert_equal " Version: 2", output.shift assert_equal " File: some_gem-2.gem", output.shift assert_equal [], output - assert_equal '', @ui.error + assert_equal "WARNING: licenses is empty\n", @ui.error gem_file = File.join @tempdir, File.basename(gem.cache_file) assert File.exist?(gem_file)