Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Expand files underneath directories

  • Loading branch information...
commit 9051ea5e69f048327eeded9200a3365f6e69f922 1 parent 5d7c1e7
Tony Arcieri authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.