Class: Dir

Inherits:
Object
  • Object
show all
Defined in:
lib/antlr3/test/core-extensions.rb

Class Method Summary collapse

Class Method Details

.children(directory) ⇒ Object


212
213
214
215
216
217
# File 'lib/antlr3/test/core-extensions.rb', line 212

def self.children( directory )
  entries = Dir.entries( directory ) - DOTS
  entries.map! do |entry|
    File.join( directory, entry )
  end
end

.mkpath(path) ⇒ Object


219
220
221
222
223
224
225
226
# File 'lib/antlr3/test/core-extensions.rb', line 219

def self.mkpath( path )
  $VERBOSE and $stderr.puts( "INFO: Dir.mkpath(%p)" % path )
  test( ?d, path ) and return( path )
  parent = File.dirname( path )
  test( ?d, parent ) or mkpath( parent )
  Dir.mkdir( path )
  return( path )
end