Class: Homebrew::DevCmd::Linkage

Inherits:
AbstractCommand show all
Defined in:
dev-cmd/linkage.rb

Instance Attribute Summary

Attributes inherited from AbstractCommand

#args

Instance Method Summary collapse

Methods inherited from AbstractCommand

command, command_name, #initialize, parser

Constructor Details

This class inherits a constructor from Homebrew::AbstractCommand

Instance Method Details

#runvoid

This method returns an undefined value.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'dev-cmd/linkage.rb', line 33

def run
  CacheStoreDatabase.use(:linkage) do |db|
    kegs = if args.named.to_default_kegs.empty?
      Formula.installed.filter_map(&:any_installed_keg)
    else
      args.named.to_default_kegs
    end
    kegs.each do |keg|
      ohai "Checking #{keg.name} linkage" if kegs.size > 1

      result = LinkageChecker.new(keg, cache_db: db)

      if args.test?
        result.display_test_output(strict: args.strict?)
        Homebrew.failed = true if result.broken_library_linkage?(test: true, strict: args.strict?)
      elsif args.reverse?
        result.display_reverse_output
      else
        result.display_normal_output
      end
    end
  end
end