Skip to content

Commit

Permalink
Support older versions of Ruby that lack Array#intersect? (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbrictson authored Jul 11, 2024
1 parent 758e9d7 commit f1f8546
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/bundle_update_interactive/cli/thor_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def handle_help_switches(given_args)

if given_args.first == "help"
retry_with_args = ["help"] if given_args.length > 1
elsif e.unknown.intersect?(%w[-h --help])
elsif (e.unknown & %w[-h --help]).any?
retry_with_args = ["help", (given_args - e.unknown).first]
end
raise unless retry_with_args.any?
Expand Down
2 changes: 1 addition & 1 deletion lib/bundle_update_interactive/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def scan_for_vulnerabilities!
vulnerable_gem_names = Set.new(audit_report.vulnerable_gems.map(&:name))

outdated_gems.each do |name, gem|
gem.vulnerable = vulnerable_gem_names.intersect?([name, *current_lockfile[name].exact_dependencies])
gem.vulnerable = (vulnerable_gem_names & [name, *current_lockfile[name].exact_dependencies]).any?
end
true
end
Expand Down

0 comments on commit f1f8546

Please sign in to comment.