Sha256: 5de1ea56c7aeb45f1e5978803060fb138b98e3d2c9d201fc3b9ae03d1844a524
Contents?: true
Size: 1.27 KB
Versions: 1
Compression:
Stored size: 1.27 KB
Contents
require 'pathname' module FasterPath module RefineFile refine File do def self.basename(pth, ext = '') pth = pth.to_path if pth.respond_to? :to_path raise TypeError unless pth.is_a? String FasterPath.basename(pth, ext) end def self.extname(pth) pth = pth.to_path if pth.respond_to? :to_path raise TypeError unless pth.is_a? String FasterPath.extname(pth) end def self.dirname(pth) pth = pth.to_path if pth.respond_to? :to_path raise TypeError unless pth.is_a? String FasterPath.dirname(pth) end end end module RefinePathname refine Pathname do def absolute? FasterPath.absolute?(@path) end def directory? FasterPath.directory?(@path) end def chop_basename(pth) FasterPath.chop_basename(pth) end private :chop_basename def relative? FasterPath.relative?(@path) end def add_trailing_separator(pth) FasterPath.add_trailing_separator(pth) end private :add_trailing_separator def has_trailing_separator?(pth) FasterPath.has_trailing_separator?(pth) end def entries FasterPath.entries(@path) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
faster_path-0.1.12 | lib/faster_path/optional/refinements.rb |