Class: Dependabot::Config::IgnoreCondition
- Inherits:
-
Object
- Object
- Dependabot::Config::IgnoreCondition
- Defined in:
- lib/dependabot/config/ignore_condition.rb
Overview
Filters versions that should not be considered for dependency updates
Constant Summary collapse
- PATCH_VERSION_TYPE =
"version-update:semver-patch"
- MINOR_VERSION_TYPE =
"version-update:semver-minor"
- MAJOR_VERSION_TYPE =
"version-update:semver-major"
- ALL_VERSIONS =
">= 0"
Instance Attribute Summary collapse
-
#dependency_name ⇒ Object
readonly
Returns the value of attribute dependency_name.
-
#update_types ⇒ Object
readonly
Returns the value of attribute update_types.
-
#versions ⇒ Object
readonly
Returns the value of attribute versions.
Instance Method Summary collapse
- #ignored_versions(dependency, security_updates_only) ⇒ Object
-
#initialize(dependency_name:, versions: nil, update_types: nil) ⇒ IgnoreCondition
constructor
A new instance of IgnoreCondition.
Constructor Details
#initialize(dependency_name:, versions: nil, update_types: nil) ⇒ IgnoreCondition
Returns a new instance of IgnoreCondition.
15 16 17 18 19 |
# File 'lib/dependabot/config/ignore_condition.rb', line 15 def initialize(dependency_name:, versions: nil, update_types: nil) @dependency_name = dependency_name @versions = versions || [] @update_types = update_types || [] end |
Instance Attribute Details
#dependency_name ⇒ Object (readonly)
Returns the value of attribute dependency_name.
13 14 15 |
# File 'lib/dependabot/config/ignore_condition.rb', line 13 def dependency_name @dependency_name end |
#update_types ⇒ Object (readonly)
Returns the value of attribute update_types.
13 14 15 |
# File 'lib/dependabot/config/ignore_condition.rb', line 13 def update_types @update_types end |
#versions ⇒ Object (readonly)
Returns the value of attribute versions.
13 14 15 |
# File 'lib/dependabot/config/ignore_condition.rb', line 13 def versions @versions end |
Instance Method Details
#ignored_versions(dependency, security_updates_only) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/dependabot/config/ignore_condition.rb', line 21 def ignored_versions(dependency, security_updates_only) return versions if security_updates_only return [ALL_VERSIONS] if versions.empty? && transformed_update_types.empty? versions_by_type(dependency) + versions end |