Class: Dependabot::PullRequestCreator::BranchNamer::Base

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

Direct Known Subclasses

DependencyGroupStrategy, SoloStrategy

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Base.



45
46
47
48
49
50
51
52
53
54
# File 'lib/dependabot/pull_request_creator/branch_namer/base.rb', line 45

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

Instance Attribute Details

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



13
14
15
# File 'lib/dependabot/pull_request_creator/branch_namer/base.rb', line 13

def dependencies
  @dependencies
end

#existing_branchesObject (readonly)

Returns the value of attribute existing_branches.



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

def existing_branches
  @existing_branches
end

#filesObject (readonly)

Returns the value of attribute files.



16
17
18
# File 'lib/dependabot/pull_request_creator/branch_namer/base.rb', line 16

def files
  @files
end

#max_lengthObject (readonly)

Returns the value of attribute max_length.



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

def max_length
  @max_length
end

#prefixObject (readonly)

Returns the value of attribute prefix.



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

def prefix
  @prefix
end

#separatorObject (readonly)

Returns the value of attribute separator.



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

def separator
  @separator
end

#target_branchObject (readonly)

Returns the value of attribute target_branch.



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

def target_branch
  @target_branch
end

Instance Method Details

#new_branch_nameObject

Raises:

  • (NotImplementedError)


57
58
59
# File 'lib/dependabot/pull_request_creator/branch_namer/base.rb', line 57

def new_branch_name
  raise NotImplementedError
end