Skip to content

Commit

Permalink
Filter out all support files from evaled_gemfiles() without listing e…
Browse files Browse the repository at this point in the history
…ach pattern separately
  • Loading branch information
kpumuk committed Mar 2, 2024
1 parent 72a48f1 commit bc29131
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
3 changes: 1 addition & 2 deletions bundler/lib/dependabot/bundler/file_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,10 @@ def evaled_gemfiles
.reject { |f| f.name.end_with?(".gemspec") }
.reject { |f| f.name.end_with?(".specification") }
.reject { |f| f.name.end_with?(".lock") }
.reject { |f| f.name.end_with?(".ruby-version") }
.reject { |f| f.name.end_with?(".tool-versions") }
.reject { |f| f.name == "Gemfile" }
.reject { |f| f.name == "gems.rb" }
.reject { |f| f.name == "gems.locked" }
.reject(&:support_file?)
end

def lockfile
Expand Down
3 changes: 1 addition & 2 deletions bundler/lib/dependabot/bundler/file_parser/file_preparer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ def evaled_gemfiles
.reject { |f| f.name.end_with?(".gemspec") }
.reject { |f| f.name.end_with?(".specification") }
.reject { |f| f.name.end_with?(".lock") }
.reject { |f| f.name.end_with?(".ruby-version") }
.reject { |f| f.name.end_with?(".tool-versions") }
.reject { |f| f.name == "Gemfile" }
.reject { |f| f.name == "gems.rb" }
.reject { |f| f.name == "gems.locked" }
.reject(&:support_file?)
end

def specification_files
Expand Down
3 changes: 1 addition & 2 deletions bundler/lib/dependabot/bundler/file_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,10 @@ def evaled_gemfiles
.reject { |f| f.name.end_with?(".gemspec") }
.reject { |f| f.name.end_with?(".specification") }
.reject { |f| f.name.end_with?(".lock") }
.reject { |f| f.name.end_with?(".ruby-version") }
.reject { |f| f.name.end_with?(".tool-versions") }
.reject { |f| f.name == "Gemfile" }
.reject { |f| f.name == "gems.rb" }
.reject { |f| f.name == "gems.locked" }
.reject(&:support_file?)
end

def updated_gemfile_content(file)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,6 @@ def evaled_gemfiles
.reject { |f| f.name.end_with?(".gemspec") }
.reject { |f| f.name.end_with?(".specification") }
.reject { |f| f.name.end_with?(".lock") }
.reject { |f| f.name.end_with?(".ruby-version") }
.reject { |f| f.name.end_with?(".tool-versions") }
.reject { |f| f.name == "Gemfile" }
.reject { |f| f.name == "gems.rb" }
.reject { |f| f.name == "gems.locked" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,10 @@ def evaled_gemfiles
.reject { |f| f.name.end_with?(".gemspec") }
.reject { |f| f.name.end_with?(".specification") }
.reject { |f| f.name.end_with?(".lock") }
.reject { |f| f.name.end_with?(".ruby-version") }
.reject { |f| f.name.end_with?(".tool-versions") }
.reject { |f| f.name == "Gemfile" }
.reject { |f| f.name == "gems.rb" }
.reject { |f| f.name == "gems.locked" }
.reject(&:support_file?)
end

def lockfile
Expand Down
3 changes: 3 additions & 0 deletions bundler/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def self.bundler_version

def bundler_project_dependency_files(project, directory: "/")
project_dependency_files(File.join("bundler#{PackageManagerHelper.bundler_version}", project), directory: directory)
.each do |dep|
dep.support_file = dep.name.end_with?(".ruby-version", ".tool-versions")
end
end

def bundler_project_dependency_file(project, filename:)
Expand Down

0 comments on commit bc29131

Please sign in to comment.