bundle/tap_dumper: typed: strict
This commit is contained in:
parent
ae76de7859
commit
19d160bfc2
@ -1,4 +1,4 @@
|
|||||||
# typed: true # rubocop:todo Sorbet/StrictSigil
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "json"
|
require "json"
|
||||||
@ -6,10 +6,12 @@ require "json"
|
|||||||
module Homebrew
|
module Homebrew
|
||||||
module Bundle
|
module Bundle
|
||||||
module TapDumper
|
module TapDumper
|
||||||
|
sig { void }
|
||||||
def self.reset!
|
def self.reset!
|
||||||
@taps = nil
|
@taps = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(String) }
|
||||||
def self.dump
|
def self.dump
|
||||||
taps.map do |tap|
|
taps.map do |tap|
|
||||||
remote = if tap.custom_remote? && (tap_remote = tap.remote)
|
remote = if tap.custom_remote? && (tap_remote = tap.remote)
|
||||||
@ -27,11 +29,14 @@ module Homebrew
|
|||||||
end.sort.uniq.join("\n")
|
end.sort.uniq.join("\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(T::Array[String]) }
|
||||||
def self.tap_names
|
def self.tap_names
|
||||||
taps.map(&:name)
|
taps.map(&:name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { returns(T::Array[Tap]) }
|
||||||
private_class_method def self.taps
|
private_class_method def self.taps
|
||||||
|
@taps ||= T.let(nil, T.nilable(T::Array[Tap]))
|
||||||
@taps ||= begin
|
@taps ||= begin
|
||||||
require "tap"
|
require "tap"
|
||||||
Tap.select(&:installed?).to_a
|
Tap.select(&:installed?).to_a
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user