forked from dependabot/dependabot-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add convenience methods for accessing version and requirement classes
- Loading branch information
Showing
5 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Dependabot | ||
VERSION = "0.52.29" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
require "dependabot/update_checkers/python/pip/requirement" | ||
require "dependabot/update_checkers/java_script/npm_and_yarn/requirement" | ||
require "dependabot/update_checkers/php/composer/requirement" | ||
require "dependabot/update_checkers/elixir/hex/requirement" | ||
require "dependabot/update_checkers/rust/cargo/requirement" | ||
|
||
module Dependabot | ||
module Requirement | ||
def self.for_package_manager(package_manager) | ||
case package_manager | ||
when "bundler", "maven", "submodules", "docker" then Gem::Requirement | ||
when "npm_and_yarn" | ||
UpdateCheckers::JavaScript::NpmAndYarn::Requirement | ||
when "pip" then UpdateCheckers::Python::Pip::Requirement | ||
when "composer" then UpdateCheckers::Php::Composer::Requirement | ||
when "hex" then UpdateCheckers::Elixir::Hex::Requirement | ||
when "cargo" then UpdateCheckers::Rust::Cargo::Requirement | ||
else raise "Unsupported package_manager #{package_manager}" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
# These must be loaded first, or we get load order errors | ||
require "dependabot/update_checkers/python/pip/requirement" | ||
require "dependabot/update_checkers/elixir/hex/requirement" | ||
|
||
require "dependabot/update_checkers/python/pip/version" | ||
require "dependabot/update_checkers/java/maven/version" | ||
require "dependabot/update_checkers/java_script/npm_and_yarn/version" | ||
require "dependabot/update_checkers/php/composer/version" | ||
require "dependabot/update_checkers/elixir/hex/version" | ||
require "dependabot/update_checkers/rust/cargo/version" | ||
|
||
module Dependabot | ||
VERSION = "0.52.29" | ||
module Version | ||
# rubocop:disable Metrics/CyclomaticComplexity | ||
def self.for_package_manager(package_manager) | ||
case package_manager | ||
when "bundler", "submodules", "docker" then Gem::Version | ||
when "maven" then UpdateCheckers::Java::Maven::Version | ||
when "npm_and_yarn" then UpdateCheckers::JavaScript::NpmAndYarn::Version | ||
when "pip" then UpdateCheckers::Python::Pip::Version | ||
when "composer" then UpdateCheckers::Php::Composer::Version | ||
when "hex" then UpdateCheckers::Elixir::Hex::Version | ||
when "cargo" then UpdateCheckers::Rust::Cargo::Version | ||
else raise "Unsupported package_manager #{package_manager}" | ||
end | ||
end | ||
# rubocop:enable Metrics/CyclomaticComplexity | ||
end | ||
end |