Class: Dependabot::Bundler::FileParser::FilePreparer

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/bundler/file_parser/file_preparer.rb

Instance Method Summary collapse

Constructor Details

#initialize(dependency_files:) ⇒ FilePreparer

Returns a new instance of FilePreparer.



17
18
19
# File 'lib/dependabot/bundler/file_parser/file_preparer.rb', line 17

def initialize(dependency_files:)
  @dependency_files = dependency_files
end

Instance Method Details

#prepared_dependency_filesObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/dependabot/bundler/file_parser/file_preparer.rb', line 22

def prepared_dependency_files
  files = gemspecs.compact.map do |file|
    DependencyFile.new(
      name: file.name,
      content: sanitize_gemspec_content(T.must(file.content)),
      directory: file.directory,
      support_file: file.support_file?
    )
  end

  files + [
    gemfile,
    *evaled_gemfiles,
    lockfile,
    ruby_version_file,
    tool_versions_file,
    *imported_ruby_files,
    *specification_files
  ].compact
end