Class: Dependabot::PullRequestCreator::BranchNamer::DependencyGroupStrategy

Inherits:
Base
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/pull_request_creator/branch_namer/dependency_group_strategy.rb

Instance Attribute Summary

Attributes inherited from Base

#dependencies, #existing_branches, #files, #max_length, #prefix, #separator, #target_branch

Instance Method Summary collapse

Constructor Details

#initialize(dependencies:, files:, target_branch:, dependency_group:, includes_security_fixes:, existing_branches: [], separator: "/", prefix: "dependabot", max_length: nil) ⇒ DependencyGroupStrategy

Returns a new instance of DependencyGroupStrategy.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/dependabot/pull_request_creator/branch_namer/dependency_group_strategy.rb', line 27

def initialize(dependencies:, files:, target_branch:, dependency_group:, includes_security_fixes:,
               existing_branches: [], separator: "/", prefix: "dependabot", max_length: nil)
  super(
    dependencies: dependencies,
    files: files,
    target_branch: target_branch,
    existing_branches: existing_branches,
    separator: separator,
    prefix: prefix,
    max_length: max_length,
  )

  @dependency_group = dependency_group
  @includes_security_fixes = includes_security_fixes
end

Instance Method Details

#new_branch_nameObject



44
45
46
# File 'lib/dependabot/pull_request_creator/branch_namer/dependency_group_strategy.rb', line 44

def new_branch_name
  sanitize_branch_name(File.join(prefixes, group_name_with_dependency_digest))
end