Skip to content
Snippets Groups Projects
Commit 12872998 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

cmd/commands: fix Rubocop warnings.

parent 984e80a7
No related branches found
No related tags found
No related merge requests found
......@@ -41,22 +41,20 @@ module Homebrew
end
def external_commands
paths.reduce([]) do |cmds, path|
paths.each_with_object([]) do |path, cmds|
Dir["#{path}/brew-*"].each do |file|
next unless File.executable?(file)
cmd = File.basename(file, ".rb")[5..-1]
cmds << cmd unless cmd.include?(".")
end
cmds
end.sort
end
private
def find_internal_commands(directory)
directory.children.reduce([]) do |cmds, f|
directory.children.each_with_object([]) do |f, cmds|
cmds << f.basename.to_s.sub(/\.(?:rb|sh)$/, "") if f.file?
cmds
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment