summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2025-11-07 07:23:07 +0900
committergit <svn-admin@ruby-lang.org>2025-11-07 20:12:47 +0000
commit2518aa9117907d7ed08f469df596c0be961fc8fe (patch)
tree42e08724e650f77d64781089eec2042af3e69b92
parent9767b31090f923200abff68657c6489e8f32cfde (diff)
[ruby/rubygems] Replace Pathname#rmtree to FileUtils.rm_rf directly
https://github.com/ruby/rubygems/commit/33c7a9a565
-rw-r--r--spec/bundler/cache/gems_spec.rb10
-rw-r--r--spec/bundler/install/gemfile/path_spec.rb2
-rw-r--r--spec/bundler/install/gems/compact_index_spec.rb2
-rw-r--r--spec/bundler/install/gems/dependency_api_spec.rb2
-rw-r--r--spec/bundler/install/path_spec.rb4
-rw-r--r--spec/bundler/runtime/load_spec.rb2
-rw-r--r--spec/bundler/support/builders.rb2
-rw-r--r--spec/bundler/update/git_spec.rb2
8 files changed, 13 insertions, 13 deletions
diff --git a/spec/bundler/cache/gems_spec.rb b/spec/bundler/cache/gems_spec.rb
index b23d475a5f..c9b85556e1 100644
--- a/spec/bundler/cache/gems_spec.rb
+++ b/spec/bundler/cache/gems_spec.rb
@@ -226,7 +226,7 @@ RSpec.describe "bundle cache" do
it "re-caches during install" do
setup_main_repo
- cached_gem("myrack-1.0.0").rmtree
+ FileUtils.rm_rf cached_gem("myrack-1.0.0")
bundle :install
expect(out).to include("Updating files in vendor/cache")
expect(cached_gem("myrack-1.0.0")).to exist
@@ -307,7 +307,7 @@ RSpec.describe "bundle cache" do
it "doesn't remove gems cached gems that don't match their remote counterparts, but also refuses to install and prints an error" do
setup_main_repo
cached_myrack = cached_gem("myrack-1.0.0")
- cached_myrack.rmtree
+ FileUtils.rm_rf cached_myrack
build_gem "myrack", "1.0.0",
path: cached_myrack.parent,
rubygems_version: "1.3.2"
@@ -338,7 +338,7 @@ RSpec.describe "bundle cache" do
it "raises an error when a cached gem is altered and produces a different checksum than the remote gem" do
setup_main_repo
- cached_gem("myrack-1.0.0").rmtree
+ FileUtils.rm_rf cached_gem("myrack-1.0.0")
build_gem "myrack", "1.0.0", path: bundled_app("vendor/cache")
checksums = checksums_section do |c|
@@ -362,14 +362,14 @@ RSpec.describe "bundle cache" do
expect(err).to include("1. remove the gem at #{cached_gem("myrack-1.0.0")}")
expect(cached_gem("myrack-1.0.0")).to exist
- cached_gem("myrack-1.0.0").rmtree
+ FileUtils.rm_rf cached_gem("myrack-1.0.0")
bundle :install
expect(cached_gem("myrack-1.0.0")).to exist
end
it "installs a modified gem with a non-matching checksum when the API implementation does not provide checksums" do
setup_main_repo
- cached_gem("myrack-1.0.0").rmtree
+ FileUtils.rm_rf cached_gem("myrack-1.0.0")
build_gem "myrack", "1.0.0", path: bundled_app("vendor/cache")
pristine_system_gems
diff --git a/spec/bundler/install/gemfile/path_spec.rb b/spec/bundler/install/gemfile/path_spec.rb
index 31d79ed41c..b55fe3dbbf 100644
--- a/spec/bundler/install/gemfile/path_spec.rb
+++ b/spec/bundler/install/gemfile/path_spec.rb
@@ -454,7 +454,7 @@ RSpec.describe "bundle install with explicit source paths" do
it "handles directories in bin/" do
build_lib "foo"
- lib_path("foo-1.0").join("foo.gemspec").rmtree
+ FileUtils.rm_rf lib_path("foo-1.0").join("foo.gemspec")
lib_path("foo-1.0").join("bin/performance").mkpath
install_gemfile <<-G
diff --git a/spec/bundler/install/gems/compact_index_spec.rb b/spec/bundler/install/gems/compact_index_spec.rb
index 64c59d4826..32a42aa93a 100644
--- a/spec/bundler/install/gems/compact_index_spec.rb
+++ b/spec/bundler/install/gems/compact_index_spec.rb
@@ -698,7 +698,7 @@ RSpec.describe "compact index api" do
bundle :install, artifice: "compact_index_forbidden"
ensure
- home(".gemrc").rmtree
+ FileUtils.rm_rf home(".gemrc")
end
end
end
diff --git a/spec/bundler/install/gems/dependency_api_spec.rb b/spec/bundler/install/gems/dependency_api_spec.rb
index 1650df3dfb..ac986a0c67 100644
--- a/spec/bundler/install/gems/dependency_api_spec.rb
+++ b/spec/bundler/install/gems/dependency_api_spec.rb
@@ -649,7 +649,7 @@ RSpec.describe "gemcutter's dependency API" do
bundle "install", artifice: "endpoint_marshal_fail"
ensure
- home(".gemrc").rmtree
+ FileUtils.rm_rf home(".gemrc")
end
end
end
diff --git a/spec/bundler/install/path_spec.rb b/spec/bundler/install/path_spec.rb
index beea1e36db..8c0793642b 100644
--- a/spec/bundler/install/path_spec.rb
+++ b/spec/bundler/install/path_spec.rb
@@ -35,7 +35,7 @@ RSpec.describe "bundle install" do
bundle :install, dir: dir
expect(out).to include("installed into `./vendor/bundle`")
- dir.rmtree
+ FileUtils.rm_rf dir
end
it "prints a message to let the user know where gems where installed" do
@@ -181,7 +181,7 @@ RSpec.describe "bundle install" do
expect(vendored_gems("extensions")).to be_directory
expect(the_bundle).to include_gems "very_simple_binary 1.0", source: "remote1"
- vendored_gems("extensions").rmtree
+ FileUtils.rm_rf vendored_gems("extensions")
run "require 'very_simple_binary_c'", raise_on_error: false
expect(err).to include("Bundler::GemNotFound")
diff --git a/spec/bundler/runtime/load_spec.rb b/spec/bundler/runtime/load_spec.rb
index 15f3d0eb5b..472cde87c5 100644
--- a/spec/bundler/runtime/load_spec.rb
+++ b/spec/bundler/runtime/load_spec.rb
@@ -68,7 +68,7 @@ RSpec.describe "Bundler.load" do
begin
expect { Bundler.load }.to raise_error(Bundler::GemfileNotFound)
ensure
- bundler_gemfile.rmtree if @remove_bundler_gemfile
+ FileUtils.rm_rf bundler_gemfile if @remove_bundler_gemfile
end
end
end
diff --git a/spec/bundler/support/builders.rb b/spec/bundler/support/builders.rb
index 50fedd38f1..3ebb7e3864 100644
--- a/spec/bundler/support/builders.rb
+++ b/spec/bundler/support/builders.rb
@@ -463,7 +463,7 @@ module Spec
FileUtils.mv bundler_path, options[:path]
end
ensure
- build_path.rmtree
+ FileUtils.rm_rf build_path
end
end
diff --git a/spec/bundler/update/git_spec.rb b/spec/bundler/update/git_spec.rb
index 2cb0abe02f..aaa039211e 100644
--- a/spec/bundler/update/git_spec.rb
+++ b/spec/bundler/update/git_spec.rb
@@ -199,7 +199,7 @@ RSpec.describe "bundle update" do
gem "foo", :git => "#{lib_path("foo-1.0")}"
G
- lib_path("foo-1.0").join(".git").rmtree
+ FileUtils.rm_rf lib_path("foo-1.0").join(".git")
bundle :update, all: true, raise_on_error: false
expect(err).to include(lib_path("foo-1.0").to_s).