Class: Dependabot::Hex::FileUpdater::MixfileGitPinUpdater

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/hex/file_updater/mixfile_git_pin_updater.rb

Instance Method Summary collapse

Constructor Details

#initialize(dependency_name:, mixfile_content:, previous_pin:, updated_pin:) ⇒ MixfileGitPinUpdater

Returns a new instance of MixfileGitPinUpdater.



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/dependabot/hex/file_updater/mixfile_git_pin_updater.rb', line 15

def initialize(
  dependency_name:,
  mixfile_content:,
  previous_pin:,
  updated_pin:
)
  @dependency_name = dependency_name
  @mixfile_content = mixfile_content
  @previous_pin    = previous_pin
  @updated_pin     = updated_pin
end

Instance Method Details

#updated_contentObject



28
29
30
31
32
33
34
# File 'lib/dependabot/hex/file_updater/mixfile_git_pin_updater.rb', line 28

def updated_content
  updated_content = update_pin(mixfile_content)

  raise "Expected content to change!" if content_should_change? && mixfile_content == updated_content

  updated_content
end