Class: Unwrappr::LockFileDiff
- Inherits:
-
Object
- Object
- Unwrappr::LockFileDiff
- Defined in:
- lib/unwrappr/lock_file_diff.rb
Overview
Responsible for identifying all gem changes between two versions of a Gemfile.lock file.
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
Instance Method Summary collapse
- #each_gem_change ⇒ Object
-
#initialize(filename:, base_file:, head_file:, patch:, sha:) ⇒ LockFileDiff
constructor
A new instance of LockFileDiff.
Constructor Details
#initialize(filename:, base_file:, head_file:, patch:, sha:) ⇒ LockFileDiff
Returns a new instance of LockFileDiff.
7 8 9 10 11 12 13 |
# File 'lib/unwrappr/lock_file_diff.rb', line 7 def initialize(filename:, base_file:, head_file:, patch:, sha:) @filename = filename @base_file = base_file @head_file = head_file @patch = patch @sha = sha end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
15 16 17 |
# File 'lib/unwrappr/lock_file_diff.rb', line 15 def filename @filename end |
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
15 16 17 |
# File 'lib/unwrappr/lock_file_diff.rb', line 15 def sha @sha end |
Instance Method Details
#each_gem_change ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/unwrappr/lock_file_diff.rb', line 17 def each_gem_change version_changes.each do |change| yield GemChange.new( name: change[:dependency].to_s, base_version: gem_version(change[:before]), head_version: gem_version(change[:after]), line_number: line_number_for_change(change), lock_file_diff: self ) end end |