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/multi_ecosystem_strategy.rb,
lib/dependabot/pull_request_creator/branch_namer/dependency_group_strategy.rb

Defined Under Namespace

Classes: Base, DependencyGroupStrategy, MultiEcosystemStrategy, SoloStrategy

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dependencies:, files:, target_branch:, dependency_group: nil, separator: "/", prefix: "dependabot", max_length: nil, word_separator: nil, branch_name_case: nil, template: nil, includes_security_fixes: false, multi_ecosystem_name: nil) ⇒ BranchNamer

Returns a new instance of BranchNamer.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 72

def initialize(
  dependencies:,
  files:,
  target_branch:,
  dependency_group: nil,
  separator: "/",
  prefix: "dependabot",
  max_length: nil,
  word_separator: nil,
  branch_name_case: nil,
  template: nil,
  includes_security_fixes: false,
  multi_ecosystem_name: nil
)
  @dependencies  = dependencies
  @files         = files
  @target_branch = target_branch
  @dependency_group = dependency_group
  @separator     = separator
  @prefix        = prefix
  @max_length    = max_length
  @word_separator = word_separator
  @branch_name_case = branch_name_case
  @template = template
  @includes_security_fixes = includes_security_fixes
  @multi_ecosystem_name = multi_ecosystem_name
end

Instance Attribute Details

#branch_name_caseObject (readonly)

Returns the value of attribute branch_name_case.



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

def branch_name_case
  @branch_name_case
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



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

def dependencies
  @dependencies
end

#dependency_groupObject (readonly)

Returns the value of attribute dependency_group.



47
48
49
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 47

def dependency_group
  @dependency_group
end

#filesObject (readonly)

Returns the value of attribute files.



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

def files
  @files
end

#includes_security_fixesObject (readonly)

Returns the value of attribute includes_security_fixes.



50
51
52
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 50

def includes_security_fixes
  @includes_security_fixes
end

#max_lengthObject (readonly)

Returns the value of attribute max_length.



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

def max_length
  @max_length
end

#multi_ecosystem_nameObject (readonly)

Returns the value of attribute multi_ecosystem_name.



53
54
55
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 53

def multi_ecosystem_name
  @multi_ecosystem_name
end

#prefixObject (readonly)

Returns the value of attribute prefix.



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

def prefix
  @prefix
end

#separatorObject (readonly)

Returns the value of attribute separator.



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

def separator
  @separator
end

#target_branchObject (readonly)

Returns the value of attribute target_branch.



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

def target_branch
  @target_branch
end

#templateObject (readonly)

Returns the value of attribute template.



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

def template
  @template
end

#word_separatorObject (readonly)

Returns the value of attribute word_separator.



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

def word_separator
  @word_separator
end

Instance Method Details

#new_branch_nameObject



101
102
103
# File 'lib/dependabot/pull_request_creator/branch_namer.rb', line 101

def new_branch_name
  strategy.new_branch_name
end