Class: Dependabot::Hex::FileUpdater

Inherits:
FileUpdaters::Base
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/hex/file_updater.rb,
lib/dependabot/hex/file_updater/mixfile_updater.rb,
lib/dependabot/hex/file_updater/lockfile_updater.rb,
lib/dependabot/hex/file_updater/mixfile_sanitizer.rb,
lib/dependabot/hex/file_updater/mixfile_git_pin_updater.rb,
lib/dependabot/hex/file_updater/mixfile_requirement_updater.rb

Defined Under Namespace

Classes: LockfileUpdater, MixfileGitPinUpdater, MixfileRequirementUpdater, MixfileSanitizer, MixfileUpdater

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.updated_files_regexObject



18
19
20
21
22
23
# File 'lib/dependabot/hex/file_updater.rb', line 18

def self.updated_files_regex
  [
    /^.*mix\.exs$/,
    /^.*mix\.lock$/
  ]
end

Instance Method Details

#updated_dependency_filesObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/dependabot/hex/file_updater.rb', line 26

def updated_dependency_files
  updated_files = []

  mixfiles.each do |file|
    if file_changed?(file)
      updated_files <<
        updated_file(file: file, content: updated_mixfile_content(file))
    end
  end

  if lockfile
    updated_files <<
      updated_file(file: T.must(lockfile), content: updated_lockfile_content)
  end

  updated_files
end