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.
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'cmd/list.rb', line 247 def initialize(path) valid_lib_extensions = [".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 |