aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/request_set/lockfile.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-19 00:34:13 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-19 00:34:13 +0000
commita7fa4d5d9aab150ad4b0c3f3217fe444df69f527 (patch)
tree88ab96d22f7228b556337aa7c34042d4fd279394 /lib/rubygems/request_set/lockfile.rb
parente7ec3dad907f2c77f17faddb40a98b2ef4523222 (diff)
downloadruby-a7fa4d5d9aab150ad4b0c3f3217fe444df69f527.tar.gz
* lib/rubygems: Update to RubyGems master 6a3d9f9. Changes include:
Compatibly renamed Gem::DependencyResolver to Gem::Resolver. Added support for git gems in gem.deps.rb and Gemfile. Fixed resolver bugs. * test/rubygems: ditto. * lib/rubygems/LICENSE.txt: Updated to license from RubyGems trunk. [ruby-trunk - Bug #9086] * lib/rubygems/commands/which_command.rb: RubyGems now indicates failure when any file is missing. [ruby-trunk - Bug #9004] * lib/rubygems/ext/builder: Extensions are now installed into the extension install directory and the first directory in the require path from the gem. This allows backwards compatibility with msgpack and other gems that calculate full require paths. [ruby-trunk - Bug #9106] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/request_set/lockfile.rb')
-rw-r--r--lib/rubygems/request_set/lockfile.rb27
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/rubygems/request_set/lockfile.rb b/lib/rubygems/request_set/lockfile.rb
index a9c419549d..0073bfdcc5 100644
--- a/lib/rubygems/request_set/lockfile.rb
+++ b/lib/rubygems/request_set/lockfile.rb
@@ -1,5 +1,3 @@
-require 'pathname'
-
class Gem::RequestSet::Lockfile
##
@@ -46,8 +44,8 @@ class Gem::RequestSet::Lockfile
def initialize request_set, gem_deps_file
@set = request_set
- @gem_deps_file = Pathname(gem_deps_file).expand_path
- @gem_deps_dir = @gem_deps_file.dirname
+ @gem_deps_file = File.expand_path(gem_deps_file)
+ @gem_deps_dir = File.dirname(@gem_deps_file)
@current_token = nil
@line = 0
@@ -62,7 +60,7 @@ class Gem::RequestSet::Lockfile
@set.dependencies.sort.map do |dependency|
source = @requests.find do |req|
req.name == dependency.name and
- req.spec.class == Gem::DependencyResolver::VendorSpecification
+ req.spec.class == Gem::Resolver::VendorSpecification
end
source_dep = '!' if source
@@ -102,15 +100,26 @@ class Gem::RequestSet::Lockfile
out << nil
end
+ def relative_path_from(dest, base)
+ dest = File.expand_path(dest)
+ base = File.expand_path(base)
+
+ if dest.index(base) == 0
+ return dest[base.size+1..-1]
+ else
+ dest
+ end
+ end
+
def add_PATH out # :nodoc:
return unless path_requests =
- @spec_groups.delete(Gem::DependencyResolver::VendorSpecification)
+ @spec_groups.delete(Gem::Resolver::VendorSpecification)
out << "PATH"
path_requests.each do |request|
- directory = Pathname(request.spec.source.uri).expand_path
+ directory = File.expand_path(request.spec.source.uri)
- out << " remote: #{directory.relative_path_from @gem_deps_dir}"
+ out << " remote: #{relative_path_from directory, @gem_deps_dir}"
out << " specs:"
out << " #{request.name} (#{request.version})"
end
@@ -208,7 +217,7 @@ class Gem::RequestSet::Lockfile
skip :newline
- set = Gem::DependencyResolver::LockSet.new source
+ set = Gem::Resolver::LockSet.new source
while not @tokens.empty? and :text == peek.first do
_, name, = get :text