lib/bundler/rubygems_integration.rb in bundler-1.5.0.rc.1 vs lib/bundler/rubygems_integration.rb in bundler-1.5.0.rc.2

- old
+ new

@@ -1,8 +1,6 @@ require 'rubygems' -# rubygems master requires UI for ConfigFile but doesn't require it -require 'rubygems/user_interaction' require 'rubygems/config_file' module Bundler class RubygemsIntegration @@ -175,22 +173,23 @@ else raise e end end - def build(spec) + def build(spec, skip_validation = false) require 'rubygems/builder' Gem::Builder.new(spec).build end def build_gem(gem_dir, spec) SharedHelpers.chdir(gem_dir) { build(spec) } end def download_gem(spec, uri, path) uri = Bundler::Source.mirror_for(uri) - Gem::RemoteFetcher.fetcher.download(spec, uri, path) + fetcher = Gem::RemoteFetcher.new(configuration[:http_proxy]) + fetcher.download(spec, uri, path) end def security_policies @security_policies ||= begin require 'rubygems/security' @@ -440,10 +439,15 @@ end def find_name(name) Gem::Specification.find_all_by_name name end + + def build(spec, skip_validation = false) + require 'rubygems/builder' + Gem::Builder.new(spec).build(skip_validation) + end end # Rubygems 1.8.0 to 1.8.4 class AlmostModern < Modern # Rubygems [>= 1.8.0, < 1.8.5] has a bug that changes Gem.dir whenever @@ -497,19 +501,27 @@ end hash end + def download_gem(spec, uri, path) + require 'resolv' + uri = Bundler::Source.mirror_for(uri) + proxy, dns = configuration[:http_proxy], Resolv::DNS.new + fetcher = Gem::RemoteFetcher.new(proxy, dns) + fetcher.download(spec, uri, path) + end + def gem_from_path(path, policy = nil) require 'rubygems/package' p = Gem::Package.new(path) p.security_policy = policy if policy return p end - def build(spec) + def build(spec, skip_validation = false) require 'rubygems/package' - Gem::Package.build(spec) + Gem::Package.build(spec, skip_validation) end end end