1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

sync_default_gems.rb: Added list subcommand

This commit is contained in:
Nobuyoshi Nakada 2020-07-13 00:30:44 +09:00
parent 6cd600ef69
commit 49cb2345c6
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -470,6 +470,13 @@ when "up"
end
when "all"
$repositories.keys.each{|gem| sync_default_gems(gem.to_s)}
when "list"
ARGV.shift
pattern = Regexp.new(ARGV.join('|'))
$repositories.each_pair do |name, gem|
next unless pattern =~ name or pattern =~ gem
printf "%-15s https://github.com/%s\n", name, gem
end
when nil, "-h", "--help"
puts <<-HELP
\e[1mSync with upstream code of default libraries\e[0m
@ -482,6 +489,12 @@ when nil, "-h", "--help"
\e[1mPick a commit range from the upstream repository\e[0m
ruby #$0 rubygems 97e9768612..9e53702832
\e[1mList known libraries\e[0m
ruby #$0 list
\e[1mList known libraries matching with patterns\e[0m
ruby #$0 list read
HELP
exit