summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/ssl_certs/certificate_manager.rb2
-rw-r--r--lib/bundler/templates/newgem/newgem.gemspec.tt7
-rw-r--r--spec/bundler/cli_spec.rb2
-rw-r--r--spec/bundler/ssl_certs/certificate_manager_spec.rb2
-rw-r--r--spec/cache/platform_spec.rb4
-rw-r--r--spec/support/helpers.rb15
-rw-r--r--spec/support/ruby_ext.rb21
7 files changed, 14 insertions, 39 deletions
diff --git a/lib/bundler/ssl_certs/certificate_manager.rb b/lib/bundler/ssl_certs/certificate_manager.rb
index f858b1e3c1..a5e5d84b64 100644
--- a/lib/bundler/ssl_certs/certificate_manager.rb
+++ b/lib/bundler/ssl_certs/certificate_manager.rb
@@ -48,7 +48,7 @@ module Bundler
private
def certificates_in(path)
- Dir[File.join(path, "*/*.pem")].sort
+ Dir[File.join(path, "**/*.pem")].sort
end
def store
diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt
index 22916f12ad..9d6d491dce 100644
--- a/lib/bundler/templates/newgem/newgem.gemspec.tt
+++ b/lib/bundler/templates/newgem/newgem.gemspec.tt
@@ -21,10 +21,13 @@ Gem::Specification.new do |spec|
if spec.respond_to?(:metadata)
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
else
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
+ raise "RubyGems 2.0 or newer is required to protect against " \
+ "public gem pushes."
end
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
+ f.match(%r{^(test|spec|features)/})
+ end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index 19c6f8277b..f283004da1 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -9,7 +9,7 @@ describe "bundle executable" do
end
it "returns non-zero exit status when passed unrecognized task" do
- bundle "unrecognized-tast"
+ bundle "unrecognized-task"
expect(exitstatus).to_not be_zero if exitstatus
end
diff --git a/spec/bundler/ssl_certs/certificate_manager_spec.rb b/spec/bundler/ssl_certs/certificate_manager_spec.rb
index 7ac8d66791..d4b76125c0 100644
--- a/spec/bundler/ssl_certs/certificate_manager_spec.rb
+++ b/spec/bundler/ssl_certs/certificate_manager_spec.rb
@@ -51,7 +51,7 @@ describe Bundler::SSLCerts::CertificateManager do
describe "#up_to_date?" do
context "when bundler certs and rubygems certs are the same" do
before do
- bundler_certs = Dir[File.join(root.to_s, "lib", "bundler", "ssl_certs", "*.pem")]
+ bundler_certs = Dir[File.join(root.to_s, "lib", "bundler", "ssl_certs", "**", "*.pem")]
FileUtils.rm(stub_cert)
FileUtils.cp(bundler_certs, rubygems_certs_dir)
end
diff --git a/spec/cache/platform_spec.rb b/spec/cache/platform_spec.rb
index e3702aaaf6..259eff0e15 100644
--- a/spec/cache/platform_spec.rb
+++ b/spec/cache/platform_spec.rb
@@ -34,7 +34,7 @@ describe "bundle cache with multiple platforms" do
cache_gems "rack-1.0.0", "activesupport-2.3.5"
end
- it "ensures that a succesful bundle install does not delete gems for other platforms" do
+ it "ensures that a successful bundle install does not delete gems for other platforms" do
bundle "install"
expect(exitstatus).to eq 0 if exitstatus
@@ -43,7 +43,7 @@ describe "bundle cache with multiple platforms" do
expect(bundled_app("vendor/cache/activesupport-2.3.5.gem")).to exist
end
- it "ensures that a succesful bundle update does not delete gems for other platforms" do
+ it "ensures that a successful bundle update does not delete gems for other platforms" do
bundle "update"
expect(exitstatus).to eq 0 if exitstatus
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 60c1c6f42f..0f10f5f677 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -2,9 +2,6 @@
module Spec
module Helpers
def reset!
- @in_p = nil
- @out_p = nil
- @err_p = nil
Dir["#{tmp}/{gems/*,*}"].each do |dir|
next if %(base remote1 gems rubygems).include?(File.basename(dir))
if ENV["BUNDLER_SUDO_TESTS"]
@@ -152,15 +149,11 @@ module Spec
def sys_exec(cmd, expect_err = false)
Open3.popen3(cmd.to_s) do |stdin, stdout, stderr, wait_thr|
- @in_p = stdin
- @out_p = stdout
- @err_p = stderr
+ yield stdin if block_given?
+ stdin.close
- yield @in_p if block_given?
- @in_p.close
-
- @out = @out_p.read_available_bytes.strip
- @err = @err_p.read_available_bytes.strip
+ @out = Thread.new { stdout.read }.value.strip
+ @err = Thread.new { stderr.read }.value.strip
@exitstatus = wait_thr && wait_thr.value.exitstatus
end
diff --git a/spec/support/ruby_ext.rb b/spec/support/ruby_ext.rb
deleted file mode 100644
index 809708b978..0000000000
--- a/spec/support/ruby_ext.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-class IO
- def read_available_bytes(chunk_size = 16_384, select_timeout = 0.02)
- buffer = []
-
- return "" if closed? || eof?
- # IO.select cannot be used here due to the fact that it
- # just does not work on windows
- loop do
- begin
- IO.select([self], nil, nil, select_timeout)
- break if eof? # stop raising :-(
- buffer << readpartial(chunk_size)
- rescue EOFError
- break
- end
- end
-
- buffer.join
- end
-end