Class: Homebrew::Cmd::ReadallCmd

Inherits:
AbstractCommand show all
Defined in:
cmd/readall.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.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'cmd/readall.rb', line 36

def run
  Homebrew.with_no_api_env do
    if args.syntax? && args.no_named?
      scan_files = "#{HOMEBREW_LIBRARY_PATH}/**/*.rb"
      ruby_files = Dir.glob(scan_files).grep_v(%r{/(vendor)/})

      Homebrew.failed = true unless Readall.valid_ruby_syntax?(ruby_files)
    end

    options = {
      aliases:     args.aliases?,
      no_simulate: args.no_simulate?,
    }
    options[:os_arch_combinations] = args.os_arch_combinations if args.os || args.arch

    taps = if args.no_named?
      if !args.eval_all? && !Homebrew::EnvConfig.eval_all?
        raise UsageError, "`brew readall` needs a tap or `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!"
      end

      Tap.installed
    else
      args.named.to_installed_taps
    end

    taps.each do |tap|
      Homebrew.failed = true unless Readall.valid_tap?(tap, **options)
    end
  end
end