summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-07-16 17:53:30 -0700
committerAndre Arko <andre@arko.net>2015-07-16 19:20:56 -0600
commit3328f9207d3025a121d2ef60f7427193cfc00ca9 (patch)
treee7502af598b0493a61082c124108d44a0bd3355f
parent6b32a4e3a5d87b95a4dc62622091fbafbab62601 (diff)
downloadbundler-3328f9207d3025a121d2ef60f7427193cfc00ca9.tar.gz
downgrade invalid specs to a warning for now
since invalid specs were allowed by 1.0-1.9, we allow them in all 1.x versions. we'll go back to throwing an exception on invalid gemspecs in Bundler 2.0. (cc @smlance) fixes #3688
-rw-r--r--lib/bundler.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 5970e2c1e4..95c86a73d2 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -367,11 +367,15 @@ module Bundler
else
spec = eval_gemspec(path, contents)
end
- Bundler.rubygems.validate(spec) if spec && validate
+ warn_on_invalid_specs(spec) if validate
spec
end
+ end
+
+ def warn_on_invalid_specs(spec)
+ spec && Bundler.rubygems.validate(spec)
rescue Gem::InvalidSpecificationException => e
- raise InvalidOption, "The gemspec at #{file} is not valid. " \
+ Bundler.ui.warn "The gemspec at #{file} is not valid. " \
"The validation error was '#{e.message}'"
end