From fde0f0713a03dbc8cf7c5cc88cf873e50cdcc585 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 19 Jul 2025 23:41:29 +0900 Subject: [PATCH 1/2] A workaround for RBS --- lib/fileutils.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/fileutils.rb b/lib/fileutils.rb index fdee182..20770a0 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -2473,6 +2473,7 @@ def fu_each_src_dest(src, dest) #:nodoc: def fu_each_src_dest0(src, dest, target_directory = true) #:nodoc: if tmp = Array.try_convert(src) unless target_directory or tmp.size <= 1 + tmp = tmp.map {|f| File.path(f)} # A workaround for RBS raise ArgumentError, "extra target #{tmp}" end tmp.each do |s| From c3abf39e7a2a0e4d320d47fdf35076e365a57d8a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 19 Jul 2025 23:44:51 +0900 Subject: [PATCH 2/2] A workaround for RBS --- lib/fileutils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 20770a0..1bcb73d 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1487,7 +1487,7 @@ def remove_file(path, force = false) # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting]. # def remove_dir(path, force = false) - raise Errno::ENOTDIR, path unless File.directory?(path) + raise Errno::ENOTDIR, path unless force or File.directory?(path) remove_entry path, force end module_function :remove_dir