Class: Dependabot::FileUpdaters::Elixir::Hex

Inherits:
Base
  • Object
show all
Defined in:
lib/dependabot/file_updaters/elixir/hex.rb,
lib/dependabot/file_updaters/elixir/hex/mixfile_updater.rb,
lib/dependabot/file_updaters/elixir/hex/lockfile_updater.rb,
lib/dependabot/file_updaters/elixir/hex/mixfile_sanitizer.rb,
lib/dependabot/file_updaters/elixir/hex/mixfile_git_pin_updater.rb,
lib/dependabot/file_updaters/elixir/hex/mixfile_requirement_updater.rb

Defined Under Namespace

Classes: LockfileUpdater, MixfileGitPinUpdater, MixfileRequirementUpdater, MixfileSanitizer, MixfileUpdater

Instance Attribute Summary

Attributes inherited from Base

#credentials, #dependencies, #dependency_files

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Dependabot::FileUpdaters::Base

Class Method Details

.updated_files_regexObject



14
15
16
17
18
19
# File 'lib/dependabot/file_updaters/elixir/hex.rb', line 14

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

Instance Method Details

#updated_dependency_filesObject



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

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