Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't remove always_install requests for local gems

If the gem was specified on the commandline, we should not remove it
from the `found` list even if it is a prerelease gem.

Fixes #828
  • Loading branch information...
commit 67ffa41d7568e7c9c3812f0559bb42316e8013e4 1 parent b71f518
@tenderlove authored
View
4 lib/rubygems/resolver/installer_set.rb
@@ -53,7 +53,9 @@ def add_always_install dependency
found = find_all request
- found.delete_if { |s| s.version.prerelease? } unless dependency.prerelease?
+ found.delete_if { |s|
+ s.version.prerelease? and not s.local?
+ } unless dependency.prerelease?
found = found.select do |s|
Gem::Source::SpecificFile === s.source or
View
4 lib/rubygems/resolver/local_specification.rb
@@ -12,5 +12,9 @@ def installable_platform?
super
end
+ def local? # :nodoc:
+ true
+ end
+
end
View
3  lib/rubygems/resolver/specification.rb
@@ -85,5 +85,8 @@ def installable_platform?
Gem::Platform.match spec.platform
end
+ def local? # :nodoc:
+ false
+ end
end
View
14 test/rubygems/test_gem_dependency_installer.rb
@@ -457,6 +457,20 @@ def test_install_local
assert_equal %w[a-1], inst.installed_gems.map { |s| s.full_name }
end
+ def test_install_local_prerelease
+ util_setup_gems
+
+ FileUtils.mv @a1_pre_gem, @tempdir
+ inst = nil
+
+ Dir.chdir @tempdir do
+ inst = Gem::DependencyInstaller.new :domain => :local
+ inst.install 'a-1.a.gem'
+ end
+
+ assert_equal %w[a-1.a], inst.installed_gems.map { |s| s.full_name }
+ end
+
def test_install_local_dependency
util_setup_gems
Please sign in to comment.
Something went wrong with that request. Please try again.