change autorequire form to only search the newest gems by version

This commit is contained in:
Thomas Reynolds 2011-08-29 11:31:27 -07:00
parent 538d2e0ebc
commit 97e8744847

View file

@ -160,8 +160,8 @@ module Middleman
EXTENSION_FILE = "middleman_init.rb" EXTENSION_FILE = "middleman_init.rb"
def self.load_extensions_in_path def self.load_extensions_in_path
# If newer Rubygems # If newer Rubygems
extensions = if Gem::Specification.respond_to? :select extensions = if Gem::Specification.respond_to? :latest_specs
::Gem::Specification.select do |spec| ::Gem::Specification.latest_specs.select do |spec|
spec.contains_requirable_file?(EXTENSION_FILE) spec.contains_requirable_file?(EXTENSION_FILE)
end end
else else