summaryrefslogtreecommitdiff
path: root/lib/bundler/dsl.rb
diff options
context:
space:
mode:
authorFrançois Beausoleil <francois@teksol.info>2011-11-02 22:27:45 -0400
committerFrançois Beausoleil <francois@teksol.info>2011-11-02 22:27:45 -0400
commit5b6573e95614bc05f86681a9d3e76486bc897092 (patch)
tree628f80d8377c22b741c92eaacc36656a6936d1c0 /lib/bundler/dsl.rb
parentc076283858aa5df9ef87b9ea06ebab60b1d12927 (diff)
downloadbundler-5b6573e95614bc05f86681a9d3e76486bc897092.tar.gz
Be explicit in what we accept as options
Diffstat (limited to 'lib/bundler/dsl.rb')
-rw-r--r--lib/bundler/dsl.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index ec9d35b695..3e1b39c70f 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -185,7 +185,8 @@ module Bundler
def _normalize_options(name, version, opts)
_normalize_hash(opts)
- invalid_keys = opts.keys - %w(group groups git github path name branch ref tag require submodules platform platforms type)
+ valid_keys = %w(group groups git github path name branch ref tag require submodules platform platforms type)
+ invalid_keys = opts.keys - valid_keys
if invalid_keys.any?
plural = invalid_keys.size > 1
message = "You passed #{invalid_keys.map{|k| ':'+k }.join(", ")} "
@@ -194,6 +195,8 @@ module Bundler
else
message << "as an option for gem '#{name}', but it is invalid."
end
+
+ message << " Valid options are: #{valid_keys.join(", ")}"
raise InvalidOption, message
end