diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-01-09 11:09:11 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-01-09 16:42:20 +0900 |
| commit | bf108636dff335903751d5a4e15d2293d7b9293f (patch) | |
| tree | 32ab5d065d12fbce8112013db08839a58f156177 /tool | |
| parent | 963131a2d90ac72eaad8c1c91fe8abfa186391e8 (diff) | |
outdate-bundled-gems.rb: Add `--only={all,curdir,srcdir}` option
Diffstat (limited to 'tool')
| -rwxr-xr-x | tool/outdate-bundled-gems.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tool/outdate-bundled-gems.rb b/tool/outdate-bundled-gems.rb index 6161cbb8cd..c7583ed67e 100755 --- a/tool/outdate-bundled-gems.rb +++ b/tool/outdate-bundled-gems.rb @@ -22,6 +22,8 @@ until ARGV.empty? gem_platform = nil when /\A--ruby[-_]version=(.*)/im ruby_version = $1 + when /\A--only=(?:(curdir|srcdir)|all)\z/im + only = $1&.downcase when /\A-/ raise "#{$0}: unknown option: #{ARGV.first}" else @@ -140,9 +142,11 @@ curdir.glob(".bundle/.timestamp/#{gem_platform}/#{ruby_version}/.*.time") do |st end end -srcdir.each_file {|f| fu.rm_f(f)} -srcdir.each_directory {|d| fu.rm_rf(d)} -unless curdir.equal?(srcdir) +unless only == "curdir" + srcdir.each_file {|f| fu.rm_f(f)} + srcdir.each_directory {|d| fu.rm_rf(d)} +end +unless only == "srcdir" or curdir.equal?(srcdir) curdir.each_file {|f| fu.rm_f(f)} curdir.each_directory {|d| fu.rm_rf(d)} end |
