lib/refinements/pathnames.rb in refinements-7.6.0 vs lib/refinements/pathnames.rb in refinements-7.7.0

- old
+ new

@@ -21,19 +21,23 @@ destination = to.directory? ? to.join(basename) : to read.then { |content| destination.write content } self end - def directories pattern = "*" - glob(pattern).select(&:directory?).sort + def directories pattern = "*", flag: File::FNM_SYSCASE + glob(pattern, flag).select(&:directory?).sort end def extensions basename.to_s.split(/(?=\.)+/).tap(&:shift) end - def files pattern = "*" - glob(pattern).select(&:file?).sort + def files pattern = "*", flag: File::FNM_SYSCASE + glob(pattern, flag).select(&:file?).sort + end + + def gsub pattern, replacement + self.class.new to_s.gsub(pattern, replacement) end def relative_parent_from root relative_path_from(root).parent end