Class: Dependabot::PullRequestCreator::Codecommit

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/pull_request_creator/codecommit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, labeler:, require_up_to_date_base:) ⇒ Codecommit

Returns a new instance of Codecommit.


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 13

def initialize(source:, branch_name:, base_commit:, credentials:,
               files:, commit_message:, pr_description:, pr_name:,
               author_details:, labeler:, require_up_to_date_base:)
  @source                  = source
  @branch_name             = branch_name
  @base_commit             = base_commit
  @credentials             = credentials
  @files                   = files
  @commit_message          = commit_message
  @pr_description          = pr_description
  @pr_name                 = pr_name
  @author_details          = author_details
  @labeler                 = labeler
  @require_up_to_date_base = require_up_to_date_base
end

Instance Attribute Details

#author_detailsObject (readonly)

Returns the value of attribute author_details


9
10
11
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 9

def author_details
  @author_details
end

#base_commitObject (readonly)

Returns the value of attribute base_commit


9
10
11
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 9

def base_commit
  @base_commit
end

#branch_nameObject (readonly)

Returns the value of attribute branch_name


9
10
11
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 9

def branch_name
  @branch_name
end

#commit_messageObject (readonly)

Returns the value of attribute commit_message


9
10
11
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 9

def commit_message
  @commit_message
end

#credentialsObject (readonly)

Returns the value of attribute credentials


9
10
11
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 9

def credentials
  @credentials
end

#filesObject (readonly)

Returns the value of attribute files


9
10
11
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 9

def files
  @files
end

#labelerObject (readonly)

Returns the value of attribute labeler


9
10
11
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 9

def labeler
  @labeler
end

#pr_descriptionObject (readonly)

Returns the value of attribute pr_description


9
10
11
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 9

def pr_description
  @pr_description
end

#pr_nameObject (readonly)

Returns the value of attribute pr_name


9
10
11
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 9

def pr_name
  @pr_name
end

#sourceObject (readonly)

Returns the value of attribute source


9
10
11
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 9

def source
  @source
end

Instance Method Details

#createObject


29
30
31
32
33
34
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 29

def create
  return if branch_exists?(branch_name) && unmerged_pull_request_exists?
  return if require_up_to_date_base? && !base_commit_is_up_to_date?

  create_pull_request
end