Class: LockDiff::Github::PrLockfile
- Inherits:
-
Object
- Object
- LockDiff::Github::PrLockfile
- Defined in:
- lib/lock_diff/github/pr_lockfile.rb
Instance Method Summary collapse
- #base_file ⇒ Object
- #changed? ⇒ Boolean
- #head_file ⇒ Object
-
#initialize(pull_request, lockfile_name) ⇒ PrLockfile
constructor
A new instance of PrLockfile.
- #path ⇒ Object
Constructor Details
#initialize(pull_request, lockfile_name) ⇒ PrLockfile
Returns a new instance of PrLockfile.
4 5 6 7 |
# File 'lib/lock_diff/github/pr_lockfile.rb', line 4 def initialize(pull_request, lockfile_name) @pr = pull_request @lockfile_name = lockfile_name end |
Instance Method Details
#base_file ⇒ Object
17 18 19 |
# File 'lib/lock_diff/github/pr_lockfile.rb', line 17 def base_file @base_file ||= LockDiff.client.file(@pr.repository, path: path, ref: @pr.base_sha) end |
#changed? ⇒ Boolean
9 10 11 |
# File 'lib/lock_diff/github/pr_lockfile.rb', line 9 def changed? !!path end |
#head_file ⇒ Object
21 22 23 |
# File 'lib/lock_diff/github/pr_lockfile.rb', line 21 def head_file @head_file ||= LockDiff.client.file(@pr.repository, path: path, ref: @pr.head_sha) end |
#path ⇒ Object
13 14 15 |
# File 'lib/lock_diff/github/pr_lockfile.rb', line 13 def path @path ||= @pr.find_content_path(@lockfile_name) end |