summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-08 18:34:26 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-10-08 18:34:26 +0100
commitd061ef848d69ad9ec444363cdd03cbdf98cfbabc (patch)
treef91f3c6413ddfccf441211b474a323b606de9324
parentade4d4962429299f81e395042fa093c65aebe98a (diff)
downloadmorph-d061ef848d69ad9ec444363cdd03cbdf98cfbabc.tar.gz
import: Give better error when rubygems.to_chunk is given wrong Gem name
Rather than saying 'no gemspecs were found', name the gemspec that we looked for because there might be some gemspecs with other names in the same directory!
-rwxr-xr-ximport/rubygems.to_chunk7
1 files changed, 6 insertions, 1 deletions
diff --git a/import/rubygems.to_chunk b/import/rubygems.to_chunk
index 63c9cd26..36e41110 100755
--- a/import/rubygems.to_chunk
+++ b/import/rubygems.to_chunk
@@ -217,7 +217,12 @@ class RubyGemChunkMorphologyGenerator < Importer::Base
# chosen .gemspec. If present, the Gemfile.lock will be honoured.
fake_gemfile = Bundler::Dsl.new
fake_gemfile.source('https://rubygems.org')
- fake_gemfile.gemspec({:name => gem_name})
+ begin
+ fake_gemfile.gemspec({:name => gem_name})
+ rescue Bundler::InvalidOption
+ error "Did not find #{gem_name}.gemspec in #{source_dir_name}"
+ exit 1
+ end
definition = fake_gemfile.to_definition('Gemfile.lock', true)
resolved_specs = definition.resolve_remotely!