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
- UPDATE_TYPES =
i( ignore_major_versions ignore_minor_versions ignore_patch_versions ).freeze
- 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) ⇒ 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.
16 17 18 19 20 |
# File 'lib/dependabot/config/ignore_condition.rb', line 16 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.
15 16 17 |
# File 'lib/dependabot/config/ignore_condition.rb', line 15 def dependency_name @dependency_name end |
#update_types ⇒ Object (readonly)
Returns the value of attribute update_types.
15 16 17 |
# File 'lib/dependabot/config/ignore_condition.rb', line 15 def update_types @update_types end |
#versions ⇒ Object (readonly)
Returns the value of attribute versions.
15 16 17 |
# File 'lib/dependabot/config/ignore_condition.rb', line 15 def versions @versions end |
Instance Method Details
#ignored_versions(dependency) ⇒ Object
22 23 24 25 26 |
# File 'lib/dependabot/config/ignore_condition.rb', line 22 def ignored_versions(dependency) return [ALL_VERSIONS] if @versions.empty? && @update_types.empty? versions_by_type(dependency) + @versions end |