Class: Dependabot::DependencyGroup
- Inherits:
-
Object
- Object
- Dependabot::DependencyGroup
- Defined in:
- lib/dependabot/dependency_group.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
Instance Method Summary collapse
- #contains?(dependency) ⇒ Boolean
-
#initialize(name:, rules:) ⇒ DependencyGroup
constructor
A new instance of DependencyGroup.
-
#to_config_yaml ⇒ Object
Provides a debug utility to view the group as it appears in the config file.
- #to_h ⇒ Object
Constructor Details
#initialize(name:, rules:) ⇒ DependencyGroup
Returns a new instance of DependencyGroup.
15 16 17 18 19 |
# File 'lib/dependabot/dependency_group.rb', line 15 def initialize(name:, rules:) @name = name @rules = rules @dependencies = [] end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
13 14 15 |
# File 'lib/dependabot/dependency_group.rb', line 13 def dependencies @dependencies end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/dependabot/dependency_group.rb', line 13 def name @name end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
13 14 15 |
# File 'lib/dependabot/dependency_group.rb', line 13 def rules @rules end |
Instance Method Details
#contains?(dependency) ⇒ Boolean
21 22 23 24 25 26 |
# File 'lib/dependabot/dependency_group.rb', line 21 def contains?(dependency) return true if @dependencies.include?(dependency) return false if matches_excluded_pattern?(dependency.name) matches_pattern?(dependency.name) && matches_dependency_type?(dependency) end |
#to_config_yaml ⇒ Object
Provides a debug utility to view the group as it appears in the config file.
33 34 35 36 37 |
# File 'lib/dependabot/dependency_group.rb', line 33 def to_config_yaml { "groups" => { name => rules } }.to_yaml.delete_prefix("---\n") end |
#to_h ⇒ Object
28 29 30 |
# File 'lib/dependabot/dependency_group.rb', line 28 def to_h { "name" => name } end |