Use type-safe blocks
This commit is contained in:
parent
3f11702fb1
commit
bbca610601
@ -183,7 +183,7 @@ module Homebrew
|
||||
require "bundle/tap_dumper"
|
||||
|
||||
@dsl ||= Brewfile.read(global:, file:)
|
||||
kept_formulae = self.kept_formulae(global:, file:).filter_map(&method(:lookup_formula))
|
||||
kept_formulae = self.kept_formulae(global:, file:).filter_map { lookup_formula(_1) }
|
||||
kept_taps = @dsl.entries.select { |e| e.type == :tap }.map(&:name)
|
||||
kept_taps += kept_formulae.filter_map(&:tap).map(&:name)
|
||||
current_taps = Homebrew::Bundle::TapDumper.tap_names
|
||||
|
@ -40,7 +40,7 @@ module Homebrew
|
||||
@formulae_by_full_name ||= {}
|
||||
|
||||
if name.nil?
|
||||
formulae = Formula.installed.map(&method(:add_formula))
|
||||
formulae = Formula.installed.map { add_formula(_1) }
|
||||
sort!(formulae)
|
||||
return @formulae_by_full_name
|
||||
end
|
||||
|
@ -128,7 +128,7 @@ module Commands
|
||||
OFFICIAL_CMD_TAPS.flat_map do |tap_name, cmds|
|
||||
tap = Tap.fetch(tap_name)
|
||||
tap.install(quiet:) unless tap.installed?
|
||||
cmds.map(&method(:external_ruby_v2_cmd_path)).compact
|
||||
cmds.map { external_ruby_v2_cmd_path(_1) }.compact
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -83,7 +83,7 @@ class DescriptionCacheStore < CacheStore
|
||||
def delete_from_formula_names!(formula_names)
|
||||
return if database.empty?
|
||||
|
||||
formula_names.each(&method(:delete!))
|
||||
formula_names.each { delete!(_1) }
|
||||
end
|
||||
alias delete_from_cask_tokens! delete_from_formula_names!
|
||||
|
||||
|
@ -49,7 +49,7 @@ module Homebrew
|
||||
ruby_files = T.let([], T::Array[Pathname])
|
||||
shell_files = T.let([], T::Array[Pathname])
|
||||
actionlint_files = T.let([], T::Array[Pathname])
|
||||
Array(files).map(&method(:Pathname))
|
||||
Array(files).map { Pathname(_1) }
|
||||
.each do |path|
|
||||
case path.extname
|
||||
when ".rb"
|
||||
|
Loading…
x
Reference in New Issue
Block a user