lib/fileutils.rb in fileutils-1.7.2 vs lib/fileutils.rb in fileutils-1.7.3
- old
+ new
@@ -178,11 +178,12 @@
#
# - {CVE-2005-0448}[https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0448].
# - {CVE-2004-0452}[https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0452].
#
module FileUtils
- VERSION = "1.7.2"
+ # The version number.
+ VERSION = "1.7.3"
def self.private_module_function(name) #:nodoc:
module_function name
private_class_method name
end
@@ -1649,11 +1650,11 @@
when "o"
mask | 01007
when "a"
mask | 07777
else
- raise ArgumentError, "invalid `who' symbol in file mode: #{chr}"
+ raise ArgumentError, "invalid 'who' symbol in file mode: #{chr}"
end
end
end
private_module_function :user_mask
@@ -1703,11 +1704,11 @@
end
need_apply = false
copy_mask = user_mask(chr)
(current_mode & copy_mask) / (copy_mask & 0111) * (user_mask & 0111)
else
- raise ArgumentError, "invalid `perm' symbol in file mode: #{chr}"
+ raise ArgumentError, "invalid 'perm' symbol in file mode: #{chr}"
end
end
if mode_mask.nonzero? || need_apply
current_mode = apply_mask(current_mode, user_mask, op, mode_mask)
@@ -2026,41 +2027,42 @@
end
module_function :touch
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)
return size if size
end
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
include StreamUtils_
@@ -2501,11 +2503,11 @@
end
output.puts msg
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 == ".")
list << base
path = parent
@@ -2522,11 +2524,11 @@
end
Array.new(base.size-i, '..').concat(target[i..-1])
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]
path = File.join(*clean, "") # ending with File::SEPARATOR
while c = comp.shift
@@ -2541,14 +2543,14 @@
clean
end
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
private_module_function :fu_starting_path?