Class: Dependabot::Swift::FileParser::DependencyParser

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/swift/file_parser/dependency_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(dependency_files:, repo_contents_path:, credentials:) ⇒ DependencyParser

Returns a new instance of DependencyParser.



14
15
16
17
18
# File 'lib/dependabot/swift/file_parser/dependency_parser.rb', line 14

def initialize(dependency_files:, repo_contents_path:, credentials:)
  @dependency_files = dependency_files
  @repo_contents_path = repo_contents_path
  @credentials = credentials
end

Instance Method Details

#parseObject



20
21
22
23
24
25
26
27
28
# File 'lib/dependabot/swift/file_parser/dependency_parser.rb', line 20

def parse
  SharedHelpers.in_a_temporary_repo_directory(dependency_files.first.directory, repo_contents_path) do
    write_temporary_dependency_files

    SharedHelpers.with_git_configured(credentials: credentials) do
      subdependencies(formatted_deps)
    end
  end
end