[ruby/fileutils] [DOC] nodoc for private methods and module

https://github.com/ruby/fileutils/commit/75c6010aab
This commit is contained in:
Nobuyoshi Nakada 2023-12-06 10:37:14 +09:00 committed by git
parent 6e704311bb
commit 2edc14be69

View File

@ -2028,21 +2028,22 @@ module FileUtils
private private
module StreamUtils_ module StreamUtils_ # :nodoc:
private private
case (defined?(::RbConfig) ? ::RbConfig::CONFIG['host_os'] : ::RUBY_PLATFORM) case (defined?(::RbConfig) ? ::RbConfig::CONFIG['host_os'] : ::RUBY_PLATFORM)
when /mswin|mingw/ when /mswin|mingw/
def fu_windows?; true end def fu_windows?; true end #:nodoc:
else else
def fu_windows?; false end def fu_windows?; false end #:nodoc:
end end
def fu_copy_stream0(src, dest, blksize = nil) #:nodoc: def fu_copy_stream0(src, dest, blksize = nil) #:nodoc:
IO.copy_stream(src, dest) IO.copy_stream(src, dest)
end end
def fu_stream_blksize(*streams) def fu_stream_blksize(*streams) #:nodoc:
streams.each do |s| streams.each do |s|
next unless s.respond_to?(:stat) next unless s.respond_to?(:stat)
size = fu_blksize(s.stat) size = fu_blksize(s.stat)
@ -2051,14 +2052,14 @@ module FileUtils
fu_default_blksize() fu_default_blksize()
end end
def fu_blksize(st) def fu_blksize(st) #:nodoc:
s = st.blksize s = st.blksize
return nil unless s return nil unless s
return nil if s == 0 return nil if s == 0
s s
end end
def fu_default_blksize def fu_default_blksize #:nodoc:
1024 1024
end end
end end
@ -2503,7 +2504,7 @@ module FileUtils
end end
private_module_function :fu_output_message private_module_function :fu_output_message
def fu_split_path(path) def fu_split_path(path) #:nodoc:
path = File.path(path) path = File.path(path)
list = [] list = []
until (parent, base = File.split(path); parent == path or parent == ".") until (parent, base = File.split(path); parent == path or parent == ".")
@ -2524,7 +2525,7 @@ module FileUtils
end end
private_module_function :fu_relative_components_from private_module_function :fu_relative_components_from
def fu_clean_components(*comp) def fu_clean_components(*comp) #:nodoc:
comp.shift while comp.first == "." comp.shift while comp.first == "."
return comp if comp.empty? return comp if comp.empty?
clean = [comp.shift] clean = [comp.shift]
@ -2543,11 +2544,11 @@ module FileUtils
private_module_function :fu_clean_components private_module_function :fu_clean_components
if fu_windows? if fu_windows?
def fu_starting_path?(path) def fu_starting_path?(path) #:nodoc:
path&.start_with?(%r(\w:|/)) path&.start_with?(%r(\w:|/))
end end
else else
def fu_starting_path?(path) def fu_starting_path?(path) #:nodoc:
path&.start_with?("/") path&.start_with?("/")
end end
end end