class Bundler::Definition

def dependencies_for(groups)

def dependencies_for(groups)
  groups.map!(&:to_sym)
  deps = current_dependencies # always returns a new array
  deps.select! do |d|
    if RUBY_VERSION >= "3.1"
      d.groups.intersect?(groups)
    else
      !(d.groups & groups).empty?
    end
  end
  deps
end