diff options
author | Andre Medeiros <me@andremedeiros.info> | 2014-02-25 10:30:32 +0100 |
---|---|---|
committer | Zachary Scott <e@zzak.io> | 2014-03-02 22:20:07 -0800 |
commit | 49aa6aa42d6c142e5c1fe32c1ea318e9cfdf6322 (patch) | |
tree | 7275695692d4fb38624ca8de7e66fab497165a64 | |
parent | 3f557a4565d74abba272ada729fa8a34686a7b6c (diff) | |
download | bundler-49aa6aa42d6c142e5c1fe32c1ea318e9cfdf6322.tar.gz |
Throw an error whenever a gem name does not conform to the C extension naming guidelines.
-rw-r--r-- | lib/bundler/cli/gem.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index 5366e66701..36663419de 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -8,6 +8,14 @@ module Bundler end def run + if options[:ext] && gem_name.index('-') + Bundler.ui.error "You have specified a gem name which does not conform to the \n" \ + "naming guidelines for C extensions. For more information, \n" \ + "see the 'Extension Naming' section at the following URL:\n" \ + "http://guides.rubygems.org/gems-with-extensions/\n" + exit 1 + end + name = gem_name.chomp("/") # remove trailing slash if present underscored_name = name.tr('-', '_') namespaced_path = name.tr('-', '/') |