Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/hooks/post-reset.rb

Instance Method Summary collapse

Instance Method Details

#any_in_dir?(dir) ⇒ Boolean

scans the list of files to see if any of them are under the given path

Returns:

  • (Boolean)


27
28
29
30
31
32
33
34
35
# File 'lib/hooks/post-reset.rb', line 27

def any_in_dir?(dir)
  if Array === dir
    exp = %r{^(?:#{dir.join('|')})/}
    any? { |file| file =~ exp }
  else
    dir += '/'
    any? { |file| file.index(dir) == 0 }
  end
end