Elaborate on sorbet comments

This commit is contained in:
Douglas Eichelberger 2023-03-13 09:08:51 -07:00
parent 04fa6e24d7
commit 0fe595f9c2

View File

@ -105,7 +105,7 @@ module Cask
@allow_reassignment = allow_reassignment @allow_reassignment = allow_reassignment
@loaded_from_api = loaded_from_api @loaded_from_api = loaded_from_api
@loader = loader @loader = loader
# https://github.com/sorbet/sorbet/issues/6843 # Sorbet has trouble with bound procs assigned to ivars: https://github.com/sorbet/sorbet/issues/6843
instance_variable_set(:@block, block) instance_variable_set(:@block, block)
@default_config = config || Config.new @default_config = config || Config.new
@ -139,7 +139,7 @@ module Cask
def timestamped_versions def timestamped_versions
relative_paths = Pathname.glob(metadata_timestamped_path(version: "*", timestamp: "*")) relative_paths = Pathname.glob(metadata_timestamped_path(version: "*", timestamp: "*"))
.map { |p| p.relative_path_from(p.parent.parent) } .map { |p| p.relative_path_from(p.parent.parent) }
# https://github.com/sorbet/sorbet/issues/6844 # Sorbet is unaware that Pathname is sortable: https://github.com/sorbet/sorbet/issues/6844
T.unsafe(relative_paths).sort_by(&:basename) # sort by timestamp T.unsafe(relative_paths).sort_by(&:basename) # sort by timestamp
.map { |p| p.split.map(&:to_s) } .map { |p| p.split.map(&:to_s) }
end end