lib/bundler/rubygems_integration.rb in bundler-1.3.0.pre.2 vs lib/bundler/rubygems_integration.rb in bundler-1.3.0.pre.3

- old
+ new

@@ -1,9 +1,18 @@ require 'rubygems' module Bundler class RubygemsIntegration + + def build_args + Gem::Command.build_args + end + + def build_args=(args) + Gem::Command.build_args = args + end + def loaded_specs(name) Gem.loaded_specs[name] end def mark_loaded(spec) @@ -98,25 +107,25 @@ # Fetch all specs, minus prerelease specs spec_list = Gem::SpecFetcher.new.list(true, false) # Then fetch the prerelease specs begin Gem::SpecFetcher.new.list(false, true).each {|k, v| spec_list[k] += v } - rescue Gem::RemoteFetcher::FetchError => e + rescue Gem::RemoteFetcher::FetchError # ignore if we can't fetch the prerelease specs end end return spec_list end def with_build_args(args) - old_args = Gem::Command.build_args + old_args = self.build_args begin - Gem::Command.build_args = args + self.build_args = args yield ensure - Gem::Command.build_args = old_args + self.build_args = old_args end end def spec_from_gem(path) require 'rubygems/format' @@ -413,19 +422,19 @@ def find_name(name) Gem::Specification.find_all_by_name name end def fetch_all_remote_specs - tuples, errors = Gem::SpecFetcher.new.available_specs(:complete) + fetched, errors = Gem::SpecFetcher.new.available_specs(:complete) # only raise if we don't get any specs back. # this means we still work if prerelease_specs.4.8.gz # don't exist but specs.4.8.gz do - if tuples.empty? && error = errors.detect {|e| e.is_a?(Gem::SourceFetchProblem) } + if fetched.empty? && error = errors.detect {|e| e.is_a?(Gem::SourceFetchProblem) } raise Gem::RemoteFetcher::FetchError.new(error.error, error.source) end hash = {} - tuples.each do |source,tuples| + fetched.each do |source, tuples| hash[source.uri] = tuples.map { |tuple| tuple.to_a } end hash end