Class: Dependabot::PullRequestUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/pull_request_updater.rb,
lib/dependabot/pull_request_updater/github.rb

Defined Under Namespace

Classes: BranchProtected, Github

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source:, base_commit:, old_commit:, files:, credentials:, pull_request_number:, author_details: nil, signature_key: nil) ⇒ PullRequestUpdater

Returns a new instance of PullRequestUpdater.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dependabot/pull_request_updater.rb', line 12

def initialize(source:, base_commit:, old_commit:, files:,
               credentials:, pull_request_number:,
               author_details: nil, signature_key: nil)
  @source              = source
  @base_commit         = base_commit
  @old_commit          = old_commit
  @files               = files
  @credentials         = credentials
  @pull_request_number = pull_request_number
  @author_details      = author_details
  @signature_key       = signature_key
end

Instance Attribute Details

#author_detailsObject (readonly)

Returns the value of attribute author_details.



9
10
11
# File 'lib/dependabot/pull_request_updater.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_updater.rb', line 9

def base_commit
  @base_commit
end

#credentialsObject (readonly)

Returns the value of attribute credentials.



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

def credentials
  @credentials
end

#filesObject (readonly)

Returns the value of attribute files.



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

def files
  @files
end

#old_commitObject (readonly)

Returns the value of attribute old_commit.



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

def old_commit
  @old_commit
end

#pull_request_numberObject (readonly)

Returns the value of attribute pull_request_number.



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

def pull_request_number
  @pull_request_number
end

#signature_keyObject (readonly)

Returns the value of attribute signature_key.



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

def signature_key
  @signature_key
end

#sourceObject (readonly)

Returns the value of attribute source.



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

def source
  @source
end

Instance Method Details

#updateObject



25
26
27
28
29
30
# File 'lib/dependabot/pull_request_updater.rb', line 25

def update
  case source.provider
  when "github" then github_updater.update
  else raise "Unsupported provider #{source.provider}"
  end
end