Class: Dependabot::Nuget::TfmComparer

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/nuget/update_checker/tfm_comparer.rb

Class Method Summary collapse

Class Method Details

.are_frameworks_compatible?(project_tfms, package_tfms) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/dependabot/nuget/update_checker/tfm_comparer.rb', line 18

def self.are_frameworks_compatible?(project_tfms, package_tfms)
  return false if package_tfms.empty?
  return false if project_tfms.empty?

  key = "project_ftms:#{project_tfms.sort.join(',')}:package_tfms:#{package_tfms.sort.join(',')}".downcase

  @cached_framework_check ||= T.let({}, T.nilable(T::Hash[String, T::Boolean]))
  unless @cached_framework_check.key?(key)
    @cached_framework_check[key] =
      NativeHelpers.run_nuget_framework_check(project_tfms,
                                              package_tfms)
  end
  T.must(@cached_framework_check[key])
end