class Pathname
Public Instance Methods
ext(newext = '')
click to toggle source
# File lib/microstation/ext/pathname.rb, line 6 def ext(newext = '') str = self.to_s return self.dup if ['.', '..'].include? str if newext != '' newext = (newext =~ /^\./) ? newext : ("." + newext) end Pathname.new(str.dup.sub!(%r(([^/\\])\.[^./\\]*$)) { $1 + newext } || str + newext) end
extstr(newext='')
click to toggle source
# File lib/microstation/ext/pathname.rb, line 15 def extstr(newext='') Pathname.new( self.to_s.ext(newext)) end
glob(pattern)
click to toggle source
# File lib/microstation/ext/pathname.rb, line 19 def glob(pattern) self.class.glob("#{self.to_s}/#{pattern}") end