Class: Dependabot::Hex::FileUpdater

Inherits:
FileUpdaters::Base
  • Object
show all
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



13
14
15
16
17
18
# File 'lib/dependabot/hex/file_updater.rb', line 13

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

Instance Method Details

#updated_dependency_filesObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/dependabot/hex/file_updater.rb', line 20

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: lockfile, content: updated_lockfile_content)
  end

  updated_files
end