Class: Homebrew::Cmd::PrettyListing Private
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
Instance Method Summary collapse
- #initialize(path) ⇒ void constructor private
Constructor Details
#initialize(path) ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
# File 'cmd/list.rb', line 348 def initialize(path) valid_lib_extensions = [".cps", ".dylib", ".pc"] 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? } when "lib" print_dir pn do |pnn| # dylibs have multiple symlinks and we don't care about them valid_lib_extensions.include?(pnn.extname) && !pnn.symlink? end when ".brew" next # Ignore .brew else if pn.directory? if pn.symlink? puts "#{pn} -> #{pn.readlink}" else print_dir pn end elsif Metafiles.list?(pn.basename.to_s) puts pn end end end end |