Class: Dependabot::PullRequestCreator::BranchNamer::SoloStrategy

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

Instance Attribute Summary

Attributes inherited from Base

#branch_name_case, #dependencies, #files, #max_length, #prefix, #separator, #target_branch, #template, #word_separator

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Dependabot::PullRequestCreator::BranchNamer::Base

Instance Method Details

#new_branch_nameObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/dependabot/pull_request_creator/branch_namer/solo_strategy.rb', line 17

def new_branch_name
  if template
    return render_from_template(
      vars: template_vars,
      strategy: :solo
    )
  end

  return short_branch_name if branch_name_might_be_long?

  @name ||=
    T.let(
      "#{template_dependency_name}-#{branch_version_suffix}",
      T.nilable(String)
    )

  sanitize_branch_name(File.join(prefixes, @name))
end