aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-06-17 22:12:41 -0500
committerJack Nagel2014-06-17 22:12:46 -0500
commit3c354e0948afb2ccb56f33e45950405d07d514b4 (patch)
tree0e25ae298d890add336a3517001bc599af317129
parenta49642629e66671b6436a97d678f8e0c2c94e3d4 (diff)
downloadhomebrew-3c354e0948afb2ccb56f33e45950405d07d514b4.tar.bz2
Use Pathname#subdirs
-rw-r--r--Library/Homebrew/cmd/list.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb
index 4ca2d8531..3f7e07d96 100644
--- a/Library/Homebrew/cmd/list.rb
+++ b/Library/Homebrew/cmd/list.rb
@@ -60,11 +60,11 @@ module Homebrew extend self
def list_versions
if ARGV.named.empty?
- HOMEBREW_CELLAR.children.select{ |pn| pn.directory? }
+ HOMEBREW_CELLAR.subdirs
else
ARGV.named.map{ |n| HOMEBREW_CELLAR+n }.select{ |pn| pn.exist? }
end.each do |d|
- versions = d.children.select{ |pn| pn.directory? }.map{ |pn| pn.basename.to_s }
+ versions = d.subdirs.map { |pn| pn.basename.to_s }
next if ARGV.include?('--multiple') && versions.count < 2
puts "#{d.basename} #{versions*' '}"
end
@@ -72,7 +72,7 @@ module Homebrew extend self
def list_pinned
if ARGV.named.empty?
- HOMEBREW_CELLAR.children.select{ |pn| pn.directory? }
+ HOMEBREW_CELLAR.subdirs
else
ARGV.named.map{ |n| HOMEBREW_CELLAR+n }.select{ |pn| pn.exist? }
end.select do |d|