lib/bundler/source/rubygems.rb in bundler-1.5.2 vs lib/bundler/source/rubygems.rb in bundler-1.5.3
- old
+ new
@@ -2,11 +2,10 @@
require 'rubygems/user_interaction'
require 'rubygems/spec_fetcher'
module Bundler
module Source
- # TODO: Refactor this class
class Rubygems
API_REQUEST_LIMIT = 100 # threshold for switching back to the modern index instead of fetching every spec
attr_reader :remotes, :caches
attr_accessor :dependency_names
@@ -66,11 +65,11 @@
def specs
@specs ||= fetch_specs
end
def install(spec)
- if installed_specs[spec].any? && gem_dir_exists?(spec)
+ if installed_specs[spec].any?
return ["Using #{spec.name} (#{spec.version})", nil]
end
# Download the gem to get the spec, because some specs that are returned
# by rubygems.org are broken and wrong.
@@ -275,18 +274,8 @@
ensure
Bundler.rubygems.sources = old
end
end
- def gem_dir_exists?(spec)
- return true if spec.name == "bundler"
- # Ruby 2 default gems
- return true if spec.loaded_from.include?("specifications/default/")
- # Ruby 1.9 default gems
- return true if spec.summary =~ /is bundled with Ruby/
-
- File.directory?(spec.full_gem_path)
- end
end
-
end
end