module Jeweler::Specification

def bundler_dependencies_for(bundler_runtime, *groups)

those gems first.
to be able to tell which gems are listed in the Gemfile without loading
This method was available until Bundler 1.13, and then removed. We need it
Backported (or rather forward-ported) from Bunder::Runtime#dependencies_for.
def bundler_dependencies_for(bundler_runtime, *groups)
  if groups.empty?
    bundler_runtime.dependencies
  else
    bundler_runtime.dependencies.select {|d| (groups & d.groups).any? }
  end
end