rvm / pluginator

A simple plugin system based on Gem.find_files
GNU Lesser General Public License v3.0
34 stars 8 forks source link

Pluginator finds deleted files in older versions of gems #3

Closed jish closed 10 years ago

jish commented 10 years ago

If pluginator searches for a file that was removed, it may find it in an older version.

Scenario: gem foo has a file called bar.rb in version 2.0. In version 3.0 the file bar.rb is removed.

The user still has both versions of the gem installed 2.0 and 3.0. When scanning for files, pluginator finds many files associated with the gem at version 3.0. However, when it comes to bar.rb, it does not find the file in version 3.0, but it does find the file in version 2.0.

When we try to activate the foo gem version 2.0, an error is raised:

~/.rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1986:in `raise_if_conflicts': can't activate foo-2.0, already activated foo-3.0 (Gem::LoadError)
    from ~/.rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:1235:in `activate'
    from ~/.gem/ruby/2.0.0/gems/pluginator-1.0.1/lib/pluginator/autodetect.rb:52:in `load_plugin'

cf: https://github.com/jish/pre-commit/issues/129