Use sort_by in PrettyListing

This commit is contained in:
Jack Nagel 2014-07-01 13:32:53 -05:00
parent a6c514024b
commit 6a1ad36fbd

View File

@ -85,7 +85,7 @@ end
class PrettyListing
def initialize path
Pathname.new(path).children.sort{ |a,b| a.to_s.downcase <=> b.to_s.downcase }.each do |pn|
Pathname.new(path).children.sort_by { |p| p.to_s.downcase }.each do |pn|
case pn.basename.to_s
when 'bin', 'sbin'
pn.find { |pnn| puts pnn unless pnn.directory? }