Skip to content

Commit

Permalink
Warn is licenses is empty. Fixes #202
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx committed Mar 12, 2012
1 parent 5806070 commit ed1098d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions lib/rubygems/specification.rb
Expand Up @@ -485,8 +485,8 @@ def extra_rdoc_files
# #
# The license must be a short name, no more than 64 characters. # 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 # This should just be the name of your license. The full
# text of the license inside of the gem when you build it. # text of the license should be inside of the gem when you build it.
# #
# Usage: # Usage:
# spec.license = 'MIT' # spec.license = 'MIT'
Expand All @@ -500,8 +500,8 @@ def license=o
# #
# Each license must be a short name, no more than 64 characters. # 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 # This should just be the name of your license. The full
# text of the license inside of the gem when you build it. # text of the license should be inside of the gem when you build it.
# #
# Usage: # Usage:
# spec.licenses = ['MIT', 'GPL-2'] # spec.licenses = ['MIT', 'GPL-2']
Expand Down Expand Up @@ -2386,6 +2386,8 @@ def validate packaging = true
end end
} }


alert_warning 'licenses is empty' if licenses.empty?

# reject lazy developers: # reject lazy developers:


# FIX: Doesn't this just evaluate to "FIXME" or "TODO"? # FIX: Doesn't this just evaluate to "FIXME" or "TODO"?
Expand Down
2 changes: 1 addition & 1 deletion test/rubygems/test_gem_commands_build_command.rb
Expand Up @@ -87,7 +87,7 @@ def util_test_build_gem(gem, gemspec_file)
assert_equal " Version: 2", output.shift assert_equal " Version: 2", output.shift
assert_equal " File: some_gem-2.gem", output.shift assert_equal " File: some_gem-2.gem", output.shift
assert_equal [], output 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) gem_file = File.join @tempdir, File.basename(gem.cache_file)
assert File.exist?(gem_file) assert File.exist?(gem_file)
Expand Down

0 comments on commit ed1098d

Please sign in to comment.