Class: Dependabot::Dep::FileUpdater

Inherits:
FileUpdaters::Base
  • Object
show all
Defined in:
lib/dependabot/dep/file_updater.rb,
lib/dependabot/dep/file_updater/lockfile_updater.rb,
lib/dependabot/dep/file_updater/manifest_updater.rb

Defined Under Namespace

Classes: LockfileUpdater, ManifestUpdater

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.updated_files_regexObject



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

def self.updated_files_regex
  [
    /^Gopkg\.toml$/,
    /^Gopkg\.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
37
38
39
# File 'lib/dependabot/dep/file_updater.rb', line 20

def updated_dependency_files
  updated_files = []

  if manifest && file_changed?(manifest)
    updated_files <<
      updated_file(
        file: manifest,
        content: updated_manifest_content
      )
  end

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

  raise "No files changed!" if updated_files.none?

  updated_files
end