Skip to content

Commit 31fb2ad

Browse files
authored
Merge pull request #20648 from Homebrew/dug/type-safe-blocks
Use type-safe blocks
2 parents 3f11702 + bbca610 commit 31fb2ad

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Library/Homebrew/bundle/commands/cleanup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def self.taps_to_untap(global: false, file: nil)
183183
require "bundle/tap_dumper"
184184

185185
@dsl ||= Brewfile.read(global:, file:)
186-
kept_formulae = self.kept_formulae(global:, file:).filter_map(&method(:lookup_formula))
186+
kept_formulae = self.kept_formulae(global:, file:).filter_map { lookup_formula(_1) }
187187
kept_taps = @dsl.entries.select { |e| e.type == :tap }.map(&:name)
188188
kept_taps += kept_formulae.filter_map(&:tap).map(&:name)
189189
current_taps = Homebrew::Bundle::TapDumper.tap_names

Library/Homebrew/bundle/formula_dumper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def self.formulae_by_full_name(name = nil)
4040
@formulae_by_full_name ||= {}
4141

4242
if name.nil?
43-
formulae = Formula.installed.map(&method(:add_formula))
43+
formulae = Formula.installed.map { add_formula(_1) }
4444
sort!(formulae)
4545
return @formulae_by_full_name
4646
end

Library/Homebrew/commands.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def self.official_external_commands_paths(quiet:)
128128
OFFICIAL_CMD_TAPS.flat_map do |tap_name, cmds|
129129
tap = Tap.fetch(tap_name)
130130
tap.install(quiet:) unless tap.installed?
131-
cmds.map(&method(:external_ruby_v2_cmd_path)).compact
131+
cmds.map { external_ruby_v2_cmd_path(_1) }.compact
132132
end
133133
end
134134

Library/Homebrew/description_cache_store.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def update_from_formula_names!(formula_names)
8383
def delete_from_formula_names!(formula_names)
8484
return if database.empty?
8585

86-
formula_names.each(&method(:delete!))
86+
formula_names.each { delete!(_1) }
8787
end
8888
alias delete_from_cask_tokens! delete_from_formula_names!
8989

Library/Homebrew/style.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def self.check_style_impl(files, output_type,
4949
ruby_files = T.let([], T::Array[Pathname])
5050
shell_files = T.let([], T::Array[Pathname])
5151
actionlint_files = T.let([], T::Array[Pathname])
52-
Array(files).map(&method(:Pathname))
52+
Array(files).map { Pathname(_1) }
5353
.each do |path|
5454
case path.extname
5555
when ".rb"

0 commit comments

Comments
 (0)