зеркало из https://github.com/github/ruby.git
Skip comment and empty lines in gems/bundled_gems file
This commit is contained in:
Родитель
41168f69fb
Коммит
358f91bf6f
|
@ -1294,6 +1294,7 @@ update-gems$(gnumake:yes=-nongnumake): PHONY
|
|||
$(Q) $(BASERUBY) -C "$(srcdir)" \
|
||||
-I./tool -rdownloader -answ \
|
||||
-e 'gem, ver = *$$F' \
|
||||
-e 'next if !ver or /^#/=~gem' \
|
||||
-e 'old = Dir.glob("gems/#{gem}-*.gem")' \
|
||||
-e 'gem = "#{gem}-#{ver}.gem"' \
|
||||
-e 'Downloader::RubyGems.download(gem, "gems", nil) and' \
|
||||
|
@ -1308,19 +1309,22 @@ extract-gems$(gnumake:yes=-nongnumake): PHONY
|
|||
-Itool -rgem-unpack -answ \
|
||||
-e 'BEGIN {FileUtils.mkdir_p(d = ".bundle/gems")}' \
|
||||
-e 'gem, ver = *$$F' \
|
||||
-e 'next if !ver or /^#/=~gem' \
|
||||
-e 'Gem.unpack("gems/#{gem}-#{ver}.gem", d)' \
|
||||
gems/bundled_gems
|
||||
|
||||
update-bundled_gems: PHONY
|
||||
$(Q) $(RUNRUBY) -rrubygems \
|
||||
-pla \
|
||||
-e 'unless /^[^#]/!~(gem=$$F[0])' \
|
||||
-e '(gem,src), = Gem::SpecFetcher.fetcher.detect(:latest) {'"|s|" \
|
||||
-e 's.platform=="ruby"&&s.name==$$F[0]' \
|
||||
-e 's.platform=="ruby"&&s.name==gem' \
|
||||
-e '}' \
|
||||
-e 'gem = src.fetch_spec(gem)' \
|
||||
-e 'uri = gem.metadata["source_code_uri"]||gem.homepage' \
|
||||
-e 'uri = uri.sub(%r[\Ahttps://github\.com/[^/]+/[^/]+\K/tree/.*], "")' \
|
||||
-e '$$_ = [gem.name, gem.version, uri].join(" ")' \
|
||||
-e 'end' \
|
||||
"$(srcdir)/gems/bundled_gems" | \
|
||||
"$(IFCHANGE)" "$(srcdir)/gems/bundled_gems" -
|
||||
|
||||
|
|
|
@ -248,7 +248,7 @@ HELP_EXTRA_TASKS = \
|
|||
|
||||
extract-gems: update-gems
|
||||
|
||||
BUNDLED_GEMS := $(shell sed 's/[ ][ ]*/-/;s/[ ].*//' $(srcdir)/gems/bundled_gems)
|
||||
BUNDLED_GEMS := $(shell sed '/^[ ]*#/d;/^[ ]*$$/d;s/[ ][ ]*/-/;s/[ ].*//' $(srcdir)/gems/bundled_gems)
|
||||
|
||||
update-gems: | $(patsubst %,gems/%.gem,$(BUNDLED_GEMS))
|
||||
|
||||
|
|
|
@ -502,6 +502,7 @@ touch-unicode-files:
|
|||
if File.exist?("gems/bundled_gems")
|
||||
gems = Dir.glob("gems/*.gem")
|
||||
gems -= File.readlines("gems/bundled_gems").map {|line|
|
||||
next if /^\s*(?:#|$)/ =~ line
|
||||
name, version, _ = line.split(' ')
|
||||
"gems/#{name}-#{version}.gem"
|
||||
}
|
||||
|
|
|
@ -923,6 +923,7 @@ install?(:ext, :comm, :gem, :'bundled-gems') do
|
|||
gem_ext_dir = "#$extout/gems/#{CONFIG['arch']}"
|
||||
extensions_dir = Gem::StubSpecification.gemspec_stub("", gem_dir, gem_dir).extensions_dir
|
||||
File.foreach("#{srcdir}/gems/bundled_gems") do |name|
|
||||
next if /^\s*(?:#|$)/ =~ name
|
||||
next unless /^(\S+)\s+(\S+).*/ =~ name
|
||||
gem_name = "#$1-#$2"
|
||||
path = "#{srcdir}/.bundle/gems/#{gem_name}/#$1.gemspec"
|
||||
|
|
|
@ -9,6 +9,7 @@ gem_dir = File.realpath('../../gems', __FILE__)
|
|||
exit_code = 0
|
||||
ruby = ENV['RUBY'] || RbConfig.ruby
|
||||
File.foreach("#{gem_dir}/bundled_gems") do |line|
|
||||
next if /^\s*(?:#|$)/ =~ line
|
||||
gem = line.split.first
|
||||
puts "\nTesting the #{gem} gem"
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче