Method: Bind::Listener#expand_dirs

Defined in:
lib/bind/listener.rb

#expand_dirs(paths) ⇒ Object

Expand directories into file paths, returns array.



44
45
46
47
48
49
50
51
52
# File 'lib/bind/listener.rb', line 44

def expand_dirs paths
  paths.inject [] do |files, path|
    case
    when File.directory?(path) ; files += Dir["#{path}/**/*.*"]
    when File.file?(path)      ; files << path
    else                         files += Dir[path]
    end
  end    
end