Class: Dir

Inherits:
Object show all
Defined in:
lib/rcl/ext/dir.rb

Overview

Class Method Summary collapse

Class Method Details

.ls(dir, glob = File.join('**','**'), &block) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/rcl/ext/dir.rb', line 5

def self.ls dir, glob = File.join('**','**'), &block
  ret = [] unless block
  Dir.glob(File.join(dir, glob)) do |entry|
    block ? block.call(entry) : ret.push(entry)
  end
  ret
end