Module: Dependabot::Utils
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/utils.rb
Constant Summary collapse
- BUMP_TMP_FILE_PREFIX =
"dependabot_"- BUMP_TMP_DIR_PATH =
T.let(File.(Dir::Tmpname.create("", "tmp") { nil }), String)
Class Method Summary collapse
- .register_requirement_class(package_manager, requirement_class) ⇒ Object
- .register_version_class(package_manager, version_class) ⇒ Object
- .requirement_class_for_package_manager(package_manager) ⇒ Object
- .version_class_for_package_manager(package_manager) ⇒ Object
Class Method Details
.register_requirement_class(package_manager, requirement_class) ⇒ Object
48 49 50 51 52 |
# File 'lib/dependabot/utils.rb', line 48 def self.register_requirement_class(package_manager, requirement_class) validate_package_manager!(package_manager) @requirement_classes[package_manager] = requirement_class end |
.register_version_class(package_manager, version_class) ⇒ Object
31 32 33 34 35 |
# File 'lib/dependabot/utils.rb', line 31 def self.register_version_class(package_manager, version_class) validate_package_manager!(package_manager) @version_classes[package_manager] = version_class end |
.requirement_class_for_package_manager(package_manager) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/dependabot/utils.rb', line 40 def self.requirement_class_for_package_manager(package_manager) requirement_class = @requirement_classes[package_manager] return requirement_class if requirement_class raise "Unregistered package_manager #{package_manager}" end |
.version_class_for_package_manager(package_manager) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/dependabot/utils.rb', line 23 def self.version_class_for_package_manager(package_manager) version_class = @version_classes[package_manager] return version_class if version_class raise "Unregistered package_manager #{package_manager}" end |