Created
July 23, 2021 08:42
-
-
Save pocke/f60bd38b6586c7d981af9b3ec3bde6f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Print gems that contains `test_files` in gemspec with disk consumed order. | |
# | |
# Usage: | |
# bundle install --path /path/to/somewhere | |
# cd /path/to/somewhere/ruby/VERSION/gems | |
# ruby THIS_SCRIPT.rb | |
# | |
# Pro tip: The following links are useful when you open a PR to remove test_files. | |
# * https://github.com/rubygems/guides/issues/90 | |
# * https://github.com/rubygems/bundler/pull/3207 | |
files = `grep test_files */*.gemspec`.split("\n").map { _1[/([^:]+):/, 1] }.uniq | |
du = `du * --summarize --bytes | sort -n`.split("\n").map { _1[/([^\s]+)$/, 1] }.reverse | |
pp files.sort_by { |f| du.find_index { |du_item| f.include? du_item } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment