module Rubyls

Constants

VERSION

Public Class Methods

ls(path: '.') click to toggle source
# File lib/rubyls.rb, line 6
def self.ls(path: '.')
  entries = Dir.entries(path)
  entries.sort!
  entries.reject! { |entry| entry.match(/^\./) }
  "#{entries.join("\t")}\n"
rescue Errno::ENOENT
  raise ArgumentError.new("ls: #{path}: No such file or directory\n")
end