Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/fileutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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|
Expand Down
Loading