Fix plugin loading in a Rails 2.3.x project [closes GH-176]
This commit is contained in:
parent
8d909b8ee4
commit
5b9bc086ac
|
@ -1,6 +1,6 @@
|
|||
## 0.6.5 (unreleased)
|
||||
|
||||
|
||||
- Fix plugin loading in a Rails 2.3.x project. [GH-176]
|
||||
|
||||
## 0.6.4 (October 4, 2010)
|
||||
|
||||
|
|
|
@ -21,15 +21,22 @@ module Vagrant
|
|||
# load path. This file is loaded to kick off the load sequence
|
||||
# for that plugin.
|
||||
def self.load!
|
||||
# Stupid hack since Rails 2.3.x overrides Gem.source_index with their
|
||||
# own incomplete replacement which causes issues.
|
||||
index = Gem.source_index
|
||||
index = [index.installed_source_index, index.vendor_source_index] if defined?(Rails::VendorGemSourceIndex) && index.is_a?(Rails::VendorGemSourceIndex)
|
||||
|
||||
# Look for a vagrant_init.rb in all the gems, but only the
|
||||
# latest version of the gems.
|
||||
Gem.source_index.latest_specs.each do |spec|
|
||||
[index].flatten.each do |source|
|
||||
source.latest_specs.each do |spec|
|
||||
file = Gem.searcher.matching_files(spec, "vagrant_init.rb").first
|
||||
next if !file
|
||||
|
||||
@@plugins << new(spec, file)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the array of plugins which are currently loaded by
|
||||
# Vagrant.
|
||||
|
|
Loading…
Reference in New Issue