Ls

Explicit, by opening the current working directory:

var content = []
Dir.cwd.open.each { |file|
    file ~~ < . .. > && next
    content.append(file)
}
 
content.sort.each { |file|
    say file
}

Implicit, by using the String.glob method:

'*'.glob.each { |file|
    say file
}

Last updated