Skip to content

Commit

Permalink
[ruby/fileutils] [DOC] nodoc for private methods and module
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu authored and matzbot committed Feb 21, 2024
1 parent 6e70431 commit 2edc14b
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions lib/fileutils.rb
Expand Up @@ -2028,21 +2028,22 @@ def touch(list, noop: nil, verbose: nil, mtime: nil, nocreate: nil)

private

module StreamUtils_
module StreamUtils_ # :nodoc:

private

case (defined?(::RbConfig) ? ::RbConfig::CONFIG['host_os'] : ::RUBY_PLATFORM)
when /mswin|mingw/
def fu_windows?; true end
def fu_windows?; true end #:nodoc:
else
def fu_windows?; false end
def fu_windows?; false end #:nodoc:
end

def fu_copy_stream0(src, dest, blksize = nil) #:nodoc:
IO.copy_stream(src, dest)
end

def fu_stream_blksize(*streams)
def fu_stream_blksize(*streams) #:nodoc:
streams.each do |s|
next unless s.respond_to?(:stat)
size = fu_blksize(s.stat)
Expand All @@ -2051,14 +2052,14 @@ def fu_stream_blksize(*streams)
fu_default_blksize()
end

def fu_blksize(st)
def fu_blksize(st) #:nodoc:
s = st.blksize
return nil unless s
return nil if s == 0
s
end

def fu_default_blksize
def fu_default_blksize #:nodoc:
1024
end
end
Expand Down Expand Up @@ -2503,7 +2504,7 @@ def fu_output_message(msg) #:nodoc:
end
private_module_function :fu_output_message

def fu_split_path(path)
def fu_split_path(path) #:nodoc:
path = File.path(path)
list = []
until (parent, base = File.split(path); parent == path or parent == ".")
Expand All @@ -2524,7 +2525,7 @@ def fu_relative_components_from(target, base) #:nodoc:
end
private_module_function :fu_relative_components_from

def fu_clean_components(*comp)
def fu_clean_components(*comp) #:nodoc:
comp.shift while comp.first == "."
return comp if comp.empty?
clean = [comp.shift]
Expand All @@ -2543,11 +2544,11 @@ def fu_clean_components(*comp)
private_module_function :fu_clean_components

if fu_windows?
def fu_starting_path?(path)
def fu_starting_path?(path) #:nodoc:
path&.start_with?(%r(\w:|/))
end
else
def fu_starting_path?(path)
def fu_starting_path?(path) #:nodoc:
path&.start_with?("/")
end
end
Expand Down

0 comments on commit 2edc14b

Please sign in to comment.