Class: GithubbishAssets::RecursiveLister

Inherits:
Object
  • Object
show all
Defined in:
lib/githubbish_assets/lister.rb

Class Method Summary collapse

Class Method Details

.[](root, ext) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/githubbish_assets/lister.rb', line 3

def self.[](root, ext)
  files = []

  root.find do |path|
    if path.file? && path.extname == ext
      files << path
    elsif path.directory? && path.basename.to_s[0] == ?.
      Find.prune
    end
  end

  files.sort
end