Class: Dependabot::Elm::FileUpdater

Inherits:
FileUpdaters::Base
  • Object
show all
Defined in:
lib/dependabot/elm/file_updater.rb,
lib/dependabot/elm/file_updater/elm_json_updater.rb

Defined Under Namespace

Classes: ElmJsonUpdater

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.updated_files_regexObject



12
13
14
15
16
# File 'lib/dependabot/elm/file_updater.rb', line 12

def self.updated_files_regex
  [
    /^elm\.json$/
  ]
end

Instance Method Details

#updated_dependency_filesObject



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

def updated_dependency_files
  updated_files = []

  elm_json_files.each do |file|
    next unless file_changed?(file)

    updated_files <<
      updated_file(
        file: file,
        content: updated_elm_json_content(file)
      )
  end

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

  updated_files
end