Skip to content

Instantly share code, notes, and snippets.

@nevans
Created November 21, 2020 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nevans/aaa80ffdfda598577b930269d4dd274d to your computer and use it in GitHub Desktop.
Save nevans/aaa80ffdfda598577b930269d4dd274d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -eo pipefail
bundle show |
grep -v '^Gems' |
sed 's/^ \* \|(\|)//g' |
while read -r line; do
gemname=$(echo "$line" | cut -f1 -d" ")
version=$(echo "$line" | cut -f2 -d" ")
gitsha1=$(echo "$line" | cut -f3 -d" ")
if [ -n "$gitsha1" ]; then
cd "$(bundle show --paths "$gemname")";
date="$(git log -1 --format=%cd --date=short)"
version="$version-$gitsha1"
cd - >/dev/null || exit
else
date=$(gem specification "$gemname" -v "$version" |
awk '/^date:/ { print $2 }')
fi
printf "%s %-36s %s\n" "$date" "$gemname" "$version"
done
#!/usr/bin/env bash
set -eo pipefail
bundle list |
grep '^ \*' |
sed 's/^ \* \|(\|)//g' |
while read -r line; do
gemname=$(echo "$line" | cut -f1 -d" ")
version=$(echo "$line" | cut -f2 -d" ")
gitsha1=$(echo "$line" | cut -f3 -d" ")
if [ -n "$gitsha1" ]; then
cd "$(bundle info --path "$gemname")";
date="$(git log -1 --format=%cd --date=short)"
version="$version-$gitsha1"
cd - >/dev/null || exit
else
date=$(bundle exec gem specification "$gemname" -v "$version" |
awk '/^date:/ { print $2 }')
fi
printf "%s %-36s %s\n" "$date" "$gemname" "$version"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment