diff options
-rw-r--r-- | bundler.gemspec | 2 | ||||
-rw-r--r-- | doc/contributing/HOW_YOU_CAN_HELP.md | 2 | ||||
-rw-r--r-- | lib/bundler/compact_index_client/updater.rb | 2 | ||||
-rw-r--r-- | lib/bundler/templates/newgem/lib/newgem.rb.tt | 1 | ||||
-rw-r--r-- | spec/bundler/compact_index_client/updater_spec.rb | 23 | ||||
-rw-r--r-- | spec/commands/exec_spec.rb | 2 | ||||
-rw-r--r-- | spec/commands/newgem_spec.rb | 4 |
7 files changed, 27 insertions, 9 deletions
diff --git a/bundler.gemspec b/bundler.gemspec index e3bfcb3539..cb1cb7fff3 100644 --- a/bundler.gemspec +++ b/bundler.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |s| s.authors = [ "André Arko", "Samuel Giddins", "Chris Morris", "James Wen", "Tim Moore", "André Medeiros", "Jessica Lynn Suttles", "Terence Lee", "Carl Lerche", - "Yehuda Katz" + "Yehuda Katz", "Colby Swandale", "Hiroshi Shibata" ] s.email = ["team@bundler.io"] s.homepage = "http://bundler.io" diff --git a/doc/contributing/HOW_YOU_CAN_HELP.md b/doc/contributing/HOW_YOU_CAN_HELP.md index 32a6107049..284bae07b2 100644 --- a/doc/contributing/HOW_YOU_CAN_HELP.md +++ b/doc/contributing/HOW_YOU_CAN_HELP.md @@ -6,7 +6,7 @@ If at any point you get stuck, here's how to [get in touch with the Bundler team ## First contribution suggestions -We track [small bugs and features](https://github.com/bundler/bundler/labels/contribution%3A%20small) so that anyone who wants to help can start with something that's not too overwhelming. +We track [small bugs and features](https://github.com/bundler/bundler/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) so that anyone who wants to help can start with something that's not too overwhelming. Generally, great ways to get started helping out with Bundler are: diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb index 91ca653e8d..950306fee5 100644 --- a/lib/bundler/compact_index_client/updater.rb +++ b/lib/bundler/compact_index_client/updater.rb @@ -83,6 +83,8 @@ module Bundler "Bundler does not have write access to create a temp directory " \ "within #{Dir.tmpdir}. Bundler must have write access to your " \ "systems temp directory to function properly. " + rescue Zlib::GzipFile::Error + raise Bundler::HTTPError end def etag_for(path) diff --git a/lib/bundler/templates/newgem/lib/newgem.rb.tt b/lib/bundler/templates/newgem/lib/newgem.rb.tt index 7d8ad90ab0..f441eab5f2 100644 --- a/lib/bundler/templates/newgem/lib/newgem.rb.tt +++ b/lib/bundler/templates/newgem/lib/newgem.rb.tt @@ -6,6 +6,7 @@ require "<%= config[:namespaced_path] %>/<%= config[:underscored_name] %>" <%- config[:constant_array].each_with_index do |c, i| -%> <%= " " * i %>module <%= c %> <%- end -%> +<%= " " * config[:constant_array].size %>class Error < StandardError; end %> <%= " " * config[:constant_array].size %># Your code goes here... <%- (config[:constant_array].size-1).downto(0) do |i| -%> <%= " " * i %>end diff --git a/spec/bundler/compact_index_client/updater_spec.rb b/spec/bundler/compact_index_client/updater_spec.rb index af24e58d5f..fd554a7b0d 100644 --- a/spec/bundler/compact_index_client/updater_spec.rb +++ b/spec/bundler/compact_index_client/updater_spec.rb @@ -5,16 +5,16 @@ require "bundler/compact_index_client" require "bundler/compact_index_client/updater" RSpec.describe Bundler::CompactIndexClient::Updater do - subject(:updater) { described_class.new(fetcher) } - let(:fetcher) { double(:fetcher) } + let(:local_path) { Pathname("/tmp/localpath") } + let(:remote_path) { double(:remote_path) } + + subject(:updater) { described_class.new(fetcher) } context "when the ETag header is missing" do # Regression test for https://github.com/bundler/bundler/issues/5463 let(:response) { double(:response, :body => "") } - let(:local_path) { Pathname("/tmp/localpath") } - let(:remote_path) { double(:remote_path) } it "MisMatchedChecksumError is raised" do # Twice: #update retries on failure @@ -28,10 +28,21 @@ RSpec.describe Bundler::CompactIndexClient::Updater do end end + context "when the download is corrupt" do + let(:response) { double(:response, :body => "") } + + it "raises HTTPError" do + expect(response).to receive(:[]).with("Content-Encoding") { "gzip" } + expect(fetcher).to receive(:call) { response } + + expect do + updater.update(local_path, remote_path) + end.to raise_error(Bundler::HTTPError) + end + end + context "when bundler doesn't have permissions on Dir.tmpdir" do let(:response) { double(:response, :body => "") } - let(:local_path) { Pathname("/tmp/localpath") } - let(:remote_path) { double(:remote_path) } it "Errno::EACCES is raised" do allow(Dir).to receive(:mktmpdir) { raise Errno::EACCES } diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index 0bda2504de..8a53ff67f0 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -786,7 +786,7 @@ __FILE__: #{path.to_s.inspect} expect(bundle!("exec ruby #{file}", :artifice => nil)).to eq(expected) # Ignore expectation for default bundler gem conflict. unless ENV["BUNDLER_SPEC_SUB_VERSION"] - expect(run!(file.read, :no_lib => true, :artifice => nil)).to eq(expected) + expect(run!(file.read, :artifice => nil)).to eq(expected) end end diff --git a/spec/commands/newgem_spec.rb b/spec/commands/newgem_spec.rb index 1a3e8236b6..f4642787cb 100644 --- a/spec/commands/newgem_spec.rb +++ b/spec/commands/newgem_spec.rb @@ -310,6 +310,10 @@ RSpec.describe "bundle gem" do expect(bundled_app("test_gem/lib/test_gem.rb").read).to match(%r{require "test_gem/version"}) end + it "creates a base error class" do + expect(bundled_app("test_gem/lib/test_gem.rb").read).to include("class Error < StandardError") + end + it "runs rake without problems" do system_gems ["rake-10.0.2"] |