ruby-changes:63967
From: Nobuyoshi <ko1@a...>
Date: Sun, 6 Dec 2020 16:12:03 +0900 (JST)
Subject: [ruby-changes:63967] 967ed35bbb (master): Moved update-bundled_gems code to a tool
https://git.ruby-lang.org/ruby.git/commit/?id=967ed35bbb From 967ed35bbb2c42646b764ce9f72d69e609e2eafd Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 6 Dec 2020 15:56:44 +0900 Subject: Moved update-bundled_gems code to a tool diff --git a/common.mk b/common.mk index 95dae70..b334056 100644 --- a/common.mk +++ b/common.mk @@ -1328,16 +1328,7 @@ extract-gems$(gnumake:yes=-nongnumake): PHONY https://github.com/ruby/ruby/blob/trunk/common.mk#L1328 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==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' \ + $(tooldir)/update-bundled_gems.rb \ "$(srcdir)/gems/bundled_gems" | \ "$(IFCHANGE)" "$(srcdir)/gems/bundled_gems" - diff --git a/tool/update-bundled_gems.rb b/tool/update-bundled_gems.rb new file mode 100644 index 0000000..905857e --- /dev/null +++ b/tool/update-bundled_gems.rb @@ -0,0 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/tool/update-bundled_gems.rb#L1 +#!ruby -pla +BEGIN { + require 'rubygems' +} +unless /^[^#]/ !~ (gem = $F[0]) + (gem, src), = Gem::SpecFetcher.fetcher.detect(:latest) {|s| + s.platform == "ruby" && s.name == gem + } + gem = src.fetch_spec(gem) + uri = gem.metadata["source_code_uri"] || gem.homepage + uri = uri.sub(%r[\Ahttps://github\.com/[^/]+/[^/]+\K/tree/.*], "") + $_ = [gem.name, gem.version, uri].join(" ") +end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/