Class: Dependabot::Nuget::FileUpdater

Inherits:
FileUpdaters::Base
  • Object
show all
Defined in:
lib/dependabot/nuget/file_updater.rb,
lib/dependabot/nuget/file_updater/property_value_updater.rb,
lib/dependabot/nuget/file_updater/project_file_declaration_finder.rb,
lib/dependabot/nuget/file_updater/packages_config_declaration_finder.rb

Defined Under Namespace

Classes: PackagesConfigDeclarationFinder, ProjectFileDeclarationFinder, PropertyValueUpdater

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.updated_files_regexObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/dependabot/nuget/file_updater.rb', line 13

def self.updated_files_regex
  [
    %r{^[^/]*\.[a-z]{2}proj$},
    /^packages\.config$/i,
    /^global\.json$/i,
    /^Directory\.Build\.props$/i,
    /^Directory\.Build\.targets$/i,
    /^Packages\.props$/i
  ]
end

Instance Method Details

#updated_dependency_filesObject



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

def updated_dependency_files
  updated_files = dependency_files.dup

  # Loop through each of the changed requirements, applying changes to
  # all files for that change. Note that the logic is different here
  # to other languages because donet has property inheritance across
  # files
  dependencies.each do |dependency|
    updated_files = update_files_for_dependency(
      files: updated_files,
      dependency: dependency
    )
  end

  updated_files.reject! { |f| dependency_files.include?(f) }

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

  updated_files
end