lib/bundler/rubygems_ext.rb in bundler-0.9.16 vs lib/bundler/rubygems_ext.rb in bundler-0.9.17

- old
+ new

@@ -29,9 +29,20 @@ gemfile = "source :gemcutter\n" gemfile << dependencies_to_gemfile(dependencies) gemfile << dependencies_to_gemfile(development_dependencies, :development) end + def add_bundler_dependencies(*groups) + groups = [:default] if groups.empty? + Bundler.definition.dependencies.each do |dep| + if dep.groups.include?(:development) + self.add_development_dependency(dep.name, dep.requirement.to_s) + elsif (dep.groups & groups).any? + self.add_dependency(dep.name, dep.requirement.to_s) + end + end + end + private def dependencies_to_gemfile(dependencies, group = nil) gemfile = '' if dependencies.any?