lib/bundler/rubygems_integration.rb in bundler-1.12.0.pre.1 vs lib/bundler/rubygems_integration.rb in bundler-1.12.0.pre.2

- old
+ new

@@ -33,10 +33,14 @@ def build_args=(args) Gem::Command.build_args = args end + def load_path_insert_index + Gem.load_path_insert_index + end + def loaded_specs(name) Gem.loaded_specs[name] end def mark_loaded(spec) @@ -48,14 +52,27 @@ Gem.loaded_specs[spec.name] = spec end def validate(spec) Bundler.ui.silence { spec.validate(false) } + rescue Gem::InvalidSpecificationException => e + error_message = "The gemspec at #{spec.loaded_from} is not valid. Please fix this gemspec.\n" \ + "The validation error was '#{e.message}'\n" + raise Gem::InvalidSpecificationException.new(error_message) rescue Errno::ENOENT nil end + def set_installed_by_version(spec, installed_by_version = Gem::VERSION) + return unless spec.respond_to?(:installed_by_version=) + spec.installed_by_version = Gem::Version.create(installed_by_version) + end + + def spec_missing_extensions?(spec) + !spec.respond_to?(:missing_extensions?) || spec.missing_extensions? + end + def path(obj) obj.to_s end def platforms @@ -497,12 +514,10 @@ def validate(spec) # Missing summary is downgraded to a warning in later versions, # so we set it to an empty string to prevent an exception here. spec.summary ||= "" - Bundler.ui.silence { spec.validate(false) } - rescue Errno::ENOENT - nil + RubygemsIntegration.instance_method(:validate).bind(self).call(spec) end end # Rubygems 1.8.5-1.8.19 class Modern < RubygemsIntegration