Permalink
Browse files

Expand files underneath directories

  • Loading branch information...
1 parent 5d7c1e7 commit 9051ea5e69f048327eeded9200a3365f6e69f922 Tony Arcieri committed Oct 16, 2009
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/require_all.rb
View
10 lib/require_all.rb
@@ -36,8 +36,14 @@ def require_all(*args)
args.flatten!
if args.size > 1
- # If we got a list, those be are files!
- files = args
+ # Expand files below directories
+ files = args.map do |path|
+ if File.directory? path
+ Dir[File.join(path, '**', '*.rb')]
+ else
+ path
+ end
+ end.flatten
else
arg = args.first
begin

0 comments on commit 9051ea5

Please sign in to comment.