From d061ef848d69ad9ec444363cdd03cbdf98cfbabc Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 8 Oct 2014 18:34:26 +0100 Subject: 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! --- import/rubygems.to_chunk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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! -- cgit v1.2.1