diff options
author | The Bundler Bot <bot@bundler.io> | 2017-06-01 07:42:05 +0000 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-06-01 23:55:32 -0500 |
commit | 388fde46c180c4e2b569329c9b962dea4ccc8671 (patch) | |
tree | 1e3dfef7549b1d0c0f61f156db958ab237ad851f /lib/bundler/cli/init.rb | |
parent | 3131fa36e2223010143a434c24779dd6e983e788 (diff) | |
download | bundler-388fde46c180c4e2b569329c9b962dea4ccc8671.tar.gz |
Auto merge of #5690 - bundler:colby/bundler-init-invalid-gemspec, r=segiddins
Fix `bundle init --gemspec` breaking when gemspec is invalid
Also added some specs to init what wasn't being tested.
(cherry picked from commit d2d669746bc4e7f55c50f730e5fc965874ab1161)
Diffstat (limited to 'lib/bundler/cli/init.rb')
-rw-r--r-- | lib/bundler/cli/init.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb index 4bbdee1f48..8ffd1db41a 100644 --- a/lib/bundler/cli/init.rb +++ b/lib/bundler/cli/init.rb @@ -18,7 +18,9 @@ module Bundler Bundler.ui.error "Gem specification #{gemspec} doesn't exist" exit 1 end - spec = Gem::Specification.load(gemspec) + + spec = Bundler.load_gemspec_uncached(gemspec) + puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile" File.open("Gemfile", "wb") do |file| file << "# Generated from #{gemspec}\n" |