mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems: Update to RubyGems 2.2.2 prerelease to check fixes to
CI. * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
bd950a75b5
commit
ea2a00d785
40 changed files with 663 additions and 109 deletions
|
@ -23,6 +23,11 @@ class Gem::Source::Git < Gem::Source
|
|||
|
||||
attr_reader :reference
|
||||
|
||||
##
|
||||
# When false the cache for this repository will not be updated.
|
||||
|
||||
attr_accessor :remote
|
||||
|
||||
##
|
||||
# The git repository this gem is sourced from.
|
||||
|
||||
|
@ -53,6 +58,7 @@ class Gem::Source::Git < Gem::Source
|
|||
@reference = reference
|
||||
@need_submodules = submodules
|
||||
|
||||
@remote = true
|
||||
@root_dir = Gem.dir
|
||||
@git = ENV['git'] || 'git'
|
||||
end
|
||||
|
@ -85,6 +91,8 @@ class Gem::Source::Git < Gem::Source
|
|||
def checkout # :nodoc:
|
||||
cache
|
||||
|
||||
return false unless File.exist? repo_cache_dir
|
||||
|
||||
unless File.exist? install_dir then
|
||||
system @git, 'clone', '--quiet', '--no-checkout',
|
||||
repo_cache_dir, install_dir
|
||||
|
@ -107,6 +115,8 @@ class Gem::Source::Git < Gem::Source
|
|||
# Creates a local cache repository for the git gem.
|
||||
|
||||
def cache # :nodoc:
|
||||
return unless @remote
|
||||
|
||||
if File.exist? repo_cache_dir then
|
||||
Dir.chdir repo_cache_dir do
|
||||
system @git, 'fetch', '--quiet', '--force', '--tags',
|
||||
|
@ -142,6 +152,8 @@ class Gem::Source::Git < Gem::Source
|
|||
# The directory where the git gem will be installed.
|
||||
|
||||
def install_dir # :nodoc:
|
||||
return unless File.exist? repo_cache_dir
|
||||
|
||||
File.join base_dir, 'gems', "#{@name}-#{dir_shortref}"
|
||||
end
|
||||
|
||||
|
@ -177,6 +189,8 @@ class Gem::Source::Git < Gem::Source
|
|||
def specs
|
||||
checkout
|
||||
|
||||
return [] unless install_dir
|
||||
|
||||
Dir.chdir install_dir do
|
||||
Dir['{,*,*/*}.gemspec'].map do |spec_file|
|
||||
directory = File.dirname spec_file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue