diff options
author | Myron Marston <myron.marston@gmail.com> | 2010-07-08 08:26:03 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-07-09 14:14:02 -0700 |
commit | 5e6b09469afd16719cdc9a0856c6f0da0489f55f (patch) | |
tree | 18f8ca0aa0c9137afbfb3fe408762502820146a8 /lib/bundler/dsl.rb | |
parent | eda732430189d638a8a6cfd9e26031b74be228d4 (diff) | |
download | bundler-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.rb | 4 |
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] |