Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Ruby list files by using glob

  • glob

if ARGV.length != 1
  puts "Usage: #{$0} DIRNAME"
  exit
end

dirname = ARGV[0]

content = Dir.glob(dirname)
print content

ruby examples/files/glob.rb "*.md"