Sha256: a1db62cbf7cca9ca4f97938827197d47507e68add3bed32b739e0d54b77cc59e
Contents?: true
Size: 393 Bytes
Versions: 14
Compression:
Stored size: 393 Bytes
Contents
class File # Returns onlt the first portion of the directory of # a file path name. # # File.rootname('lib/jump.rb') #=> 'lib' # File.rootname('/jump.rb') #=> '/' # File.rootname('jump.rb') #=> '.' # def self.rootname( file_name ) i = file_name.index('/') if i r = file_name[0...i] r == '' ? '/' : r else '.' end end end
Version data entries
14 entries across 14 versions & 1 rubygems