Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/hooks/post-reset.rb
Instance Method Summary collapse
-
#any_in_dir?(dir) ⇒ Boolean
scans the list of files to see if any of them are under the given path.
Instance Method Details
#any_in_dir?(dir) ⇒ Boolean
scans the list of files to see if any of them are under the given path
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 |