Class: Unwrappr::Github::PrSource
- Inherits:
-
Object
- Object
- Unwrappr::Github::PrSource
- Defined in:
- lib/unwrappr/github/pr_source.rb
Overview
Obtains Gemfile.lock changes from a Github Pull Request
Implements the ‘lock_file_diff_source` interface as defined by the LockFileAnnotator.
Instance Method Summary collapse
- #each_file ⇒ Object
-
#initialize(repo, pr_number, lock_files, client) ⇒ PrSource
constructor
A new instance of PrSource.
Constructor Details
#initialize(repo, pr_number, lock_files, client) ⇒ PrSource
Returns a new instance of PrSource.
12 13 14 15 16 17 |
# File 'lib/unwrappr/github/pr_source.rb', line 12 def initialize(repo, pr_number, lock_files, client) @repo = repo @pr_number = pr_number @lock_files = lock_files @client = client end |
Instance Method Details
#each_file ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/unwrappr/github/pr_source.rb', line 19 def each_file lock_file_diffs.each do |lock_file_diff| yield LockFileDiff.new( filename: lock_file_diff.filename, base_file: file_contents(lock_file_diff.filename, base_sha), head_file: file_contents(lock_file_diff.filename, head_sha), patch: lock_file_diff.patch, sha: head_sha ) end end |