Class: Dependabot::PullRequestCreator::BranchNamer

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

Defined Under Namespace

Classes: Base, DependencyGroupStrategy, SoloStrategy

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of BranchNamer.



58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 58

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

Instance Attribute Details

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



18
19
20
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 18

def dependencies
  @dependencies
end

#dependency_groupObject (readonly)

Returns the value of attribute dependency_group.



39
40
41
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 39

def dependency_group
  @dependency_group
end

#existing_branchesObject (readonly)

Returns the value of attribute existing_branches.



27
28
29
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 27

def existing_branches
  @existing_branches
end

#filesObject (readonly)

Returns the value of attribute files.



21
22
23
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 21

def files
  @files
end

#includes_security_fixesObject (readonly)

Returns the value of attribute includes_security_fixes.



42
43
44
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 42

def includes_security_fixes
  @includes_security_fixes
end

#max_lengthObject (readonly)

Returns the value of attribute max_length.



36
37
38
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 36

def max_length
  @max_length
end

#prefixObject (readonly)

Returns the value of attribute prefix.



33
34
35
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 33

def prefix
  @prefix
end

#separatorObject (readonly)

Returns the value of attribute separator.



30
31
32
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 30

def separator
  @separator
end

#target_branchObject (readonly)

Returns the value of attribute target_branch.



24
25
26
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 24

def target_branch
  @target_branch
end

Instance Method Details

#new_branch_nameObject



72
73
74
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 72

def new_branch_name
  strategy.new_branch_name
end