Skip to content

Instantly share code, notes, and snippets.

@krin-san
Created November 16, 2021 09:32
Show Gist options
  • Save krin-san/a2eb05a469be7590975096252f597e4e to your computer and use it in GitHub Desktop.
Save krin-san/a2eb05a469be7590975096252f597e4e to your computer and use it in GitHub Desktop.
List gems without reverse dependencies
#!/bin/bash
# Provides list of gems that have nothing depending on them
for target in $(gem list -l --no-verbose | cut -d ' ' -f 1); do
if [ "$(gem dependency -lr $target | wc -l)" -eq 2 ]; then
echo "$target"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment