summaryrefslogtreecommitdiff
path: root/lib/bundler/dsl.rb
diff options
context:
space:
mode:
authorMyron Marston <myron.marston@gmail.com>2010-07-08 08:26:03 -0700
committerwycats <wycats@gmail.com>2010-07-09 14:14:02 -0700
commit5e6b09469afd16719cdc9a0856c6f0da0489f55f (patch)
tree18f8ca0aa0c9137afbfb3fe408762502820146a8 /lib/bundler/dsl.rb
parenteda732430189d638a8a6cfd9e26031b74be228d4 (diff)
downloadbundler-5e6b09469afd16719cdc9a0856c6f0da0489f55f.tar.gz
Raise an appropriate error when a gem is specified using a symbol.
Previously, bundler would raise an error like "Could not find gem 'foo' in any of the gem sources", which was misleading and confusing. This closes #434.
Diffstat (limited to 'lib/bundler/dsl.rb')
-rw-r--r--lib/bundler/dsl.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index 9be847d583..e2994e4b26 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -44,6 +44,10 @@ module Bundler
end
def gem(name, *args)
+ if name.is_a?(Symbol)
+ raise GemfileError, %{You need to specify gem names as Strings. Use 'gem "#{name.to_s}"' instead.}
+ end
+
options = Hash === args.last ? args.pop : {}
version = args.last || ">= 0"
if group = options[:groups] || options[:group]