diff --git a/.gitignore b/.gitignore index 62521fed..2d8f9b51 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store tmp -pkg \ No newline at end of file +pkg +testing/Gemfile \ No newline at end of file diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 29e024a7..d111bd23 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -25,6 +25,9 @@ def self.run(command, options = {}) rescue SourceNotCached => e Bundler.logger.error e.message exit 9 + rescue ManifestFileNotFound => e + Bundler.logger.error e.message + exit 10 end def initialize(options) diff --git a/lib/bundler/environment.rb b/lib/bundler/environment.rb index 5fd1c201..d1137868 100644 --- a/lib/bundler/environment.rb +++ b/lib/bundler/environment.rb @@ -14,7 +14,7 @@ def self.load(gemfile = nil) gemfile = gemfile ? Pathname.new(gemfile).expand_path : default_manifest_file unless gemfile.file? - raise ManifestFileNotFound, "#{filename.inspect} does not exist" + raise ManifestFileNotFound, "Manifest file not found: #{gemfile.to_s.inspect}" end new(gemfile) diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb index b04c2d3e..1174cd70 100644 --- a/spec/bundler/cli_spec.rb +++ b/spec/bundler/cli_spec.rb @@ -125,6 +125,11 @@ end end + it "raises when providing a bad manifest" do + out = gem_command :bundle, "-m manifest_not_here" + out.should =~ /Manifest file not found: \".*manifest_not_here\"/ + end + describe "it working while specifying the manifest file name" do it "works when the manifest is in the root directory" do build_manifest_file bundled_app('manifest.rb'), <<-Gemfile