Module: Dependabot::Utils

Defined in:
lib/dependabot/utils.rb

Class Method Summary collapse

Class Method Details

.register_requirement_class(package_manager, requirement_class) ⇒ Object



29
30
31
# File 'lib/dependabot/utils.rb', line 29

def self.register_requirement_class(package_manager, requirement_class)
  @requirement_classes[package_manager] = requirement_class
end

.register_version_class(package_manager, version_class) ⇒ Object



16
17
18
# File 'lib/dependabot/utils.rb', line 16

def self.register_version_class(package_manager, version_class)
  @version_classes[package_manager] = version_class
end

.requirement_class_for_package_manager(package_manager) ⇒ Object



22
23
24
25
26
27
# File 'lib/dependabot/utils.rb', line 22

def self.requirement_class_for_package_manager(package_manager)
  requirement_class = @requirement_classes[package_manager]
  return requirement_class if requirement_class

  raise "Unsupported package_manager #{package_manager}"
end

.version_class_for_package_manager(package_manager) ⇒ Object



9
10
11
12
13
14
# File 'lib/dependabot/utils.rb', line 9

def self.version_class_for_package_manager(package_manager)
  version_class = @version_classes[package_manager]
  return version_class if version_class

  raise "Unsupported package_manager #{package_manager}"
end