Skip to content

Commit

Permalink
bundler: avoid reparsing same gemspec (#9458)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakecoffman committed Apr 9, 2024
1 parent 0bc8974 commit a3dba8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bundler/lib/dependabot/bundler/file_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ def gemfile_dependencies
dependencies
end

def gemspec_dependencies
def gemspec_dependencies # rubocop:disable Metrics/PerceivedComplexity
return @gemspec_dependencies if defined?(@gemspec_dependencies)

queue = Queue.new

SharedHelpers.in_a_temporary_repo_directory(base_directory, repo_contents_path) do
Expand Down Expand Up @@ -108,7 +110,7 @@ def gemspec_dependencies

dependency_set = DependencySet.new
dependency_set << queue.pop(true) while queue.size.positive?
dependency_set
@gemspec_dependencies ||= dependency_set
end

def lockfile_dependencies
Expand Down

0 comments on commit a3dba8f

Please sign in to comment.