Class: Dependabot::Publish
- Inherits:
-
Object
- Object
- Dependabot::Publish
- Defined in:
- lib/dependabot/publish.rb
Instance Attribute Summary collapse
-
#dependency ⇒ Object
readonly
Returns the value of attribute dependency.
-
#git ⇒ Object
readonly
Returns the value of attribute git.
-
#pull_request ⇒ Object
readonly
Returns the value of attribute pull_request.
Instance Method Summary collapse
-
#initialize(dependency, git: Dependabot::Git.for(dependency)) ⇒ Publish
constructor
A new instance of Publish.
- #update!(push: false) ⇒ Object
Constructor Details
#initialize(dependency, git: Dependabot::Git.for(dependency)) ⇒ Publish
Returns a new instance of Publish.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/dependabot/publish.rb', line 7 def initialize(dependency, git: Dependabot::Git.for(dependency)) @dependency = dependency @git = git @pull_request = PullRequest.new( nwo: GitHub.name_with_owner_from(git.repo.remotes["origin"].url), base: git.repo.head.name, head: "dependanot/#{dependency.package_manager}/#{dependency.name}", dependency: dependency ) end |
Instance Attribute Details
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
5 6 7 |
# File 'lib/dependabot/publish.rb', line 5 def dependency @dependency end |
#git ⇒ Object (readonly)
Returns the value of attribute git.
5 6 7 |
# File 'lib/dependabot/publish.rb', line 5 def git @git end |
#pull_request ⇒ Object (readonly)
Returns the value of attribute pull_request.
5 6 7 |
# File 'lib/dependabot/publish.rb', line 5 def pull_request @pull_request end |
Instance Method Details
#update!(push: false) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/dependabot/publish.rb', line 18 def update!(push: false) transaction(push: push) do |after_commit| ::Spandx::Core::Plugin.enhance(dependency) after_commit.new do Dependabot.logger.debug(git.patch) Dependabot.github.create(pull_request) end end end |