aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/commands.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/commands.rb b/Library/Homebrew/cmd/commands.rb
index a3527bc94..0dfc6c451 100644
--- a/Library/Homebrew/cmd/commands.rb
+++ b/Library/Homebrew/cmd/commands.rb
@@ -51,8 +51,8 @@ module Homebrew
end
def find_internal_commands(directory)
- directory.children.each_with_object([]) do |f, cmds|
- cmds << f.basename.to_s.sub(/\.(?:rb|sh)$/, "") if f.file?
- end
+ Pathname.glob(directory/"*")
+ .select(&:file?)
+ .map { |f| f.basename.to_s.sub(/\.(?:rb|sh)$/, "") }
end
end