Class: Dependabot::Cargo::UpdateChecker::FilePreparer
- Inherits:
-
Object
- Object
- Dependabot::Cargo::UpdateChecker::FilePreparer
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/cargo/update_checker/file_preparer.rb
Overview
This class takes a set of dependency files and sanitizes them for use in UpdateCheckers::Rust::Cargo.
Instance Method Summary collapse
-
#initialize(dependency_files:, dependency:, unlock_requirement: true, replacement_git_pin: nil, latest_allowable_version: nil) ⇒ FilePreparer
constructor
A new instance of FilePreparer.
- #prepared_dependency_files ⇒ Object
Constructor Details
#initialize(dependency_files:, dependency:, unlock_requirement: true, replacement_git_pin: nil, latest_allowable_version: nil) ⇒ FilePreparer
Returns a new instance of FilePreparer.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/dependabot/cargo/update_checker/file_preparer.rb', line 29 def initialize( dependency_files:, dependency:, unlock_requirement: true, replacement_git_pin: nil, latest_allowable_version: nil ) @dependency_files = dependency_files @dependency = dependency @unlock_requirement = unlock_requirement @replacement_git_pin = replacement_git_pin @latest_allowable_version = latest_allowable_version @lower_bound_version = T.let(nil, T.nilable(T.any(String, Integer))) @manifest_files = T.let(nil, T.nilable(T::Array[Dependabot::DependencyFile])) @lockfile = T.let(nil, T.nilable(Dependabot::DependencyFile)) @toolchain = T.let(nil, T.nilable(Dependabot::DependencyFile)) end |
Instance Method Details
#prepared_dependency_files ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/dependabot/cargo/update_checker/file_preparer.rb', line 48 def prepared_dependency_files files = [] files += manifest_files.map do |file| DependencyFile.new( name: file.name, content: manifest_content_for_update_check(file), directory: file.directory ) end files << lockfile if lockfile files << toolchain if toolchain files end |