Class: LockDiff::LockfileComparator

Inherits:
Object
  • Object
show all
Defined in:
lib/lock_diff/lockfile_comparator.rb

Class Method Summary collapse

Class Method Details

.compare_by(pull_request) ⇒ Object

Raises:

  • (NotChangedLockfile)


4
5
6
7
8
9
10
11
12
# File 'lib/lock_diff/lockfile_comparator.rb', line 4

def compare_by(pull_request)
  file_path = pull_request.find_content_path(lockfile_name)
  raise NotChangedLockfile if file_path.nil?

  LockDiff.config.strategy.lockfile_comparator.new(
    old_lockfile: pull_request.base_file(file_path),
    new_lockfile: pull_request.head_file(file_path)
  ).call
end

.lockfile_nameObject



14
15
16
# File 'lib/lock_diff/lockfile_comparator.rb', line 14

def lockfile_name
  LockDiff.config.strategy.lockfile_name
end