Skip to content

Instantly share code, notes, and snippets.

@lsantosc
Forked from wacko/gemcount
Created June 21, 2017 20:53
Show Gist options
  • Save lsantosc/3baf2f8db9d2c6e9a96c8b45296cd729 to your computer and use it in GitHub Desktop.
Save lsantosc/3baf2f8db9d2c6e9a96c8b45296cd729 to your computer and use it in GitHub Desktop.
List all the different gems on your Gemfile.lock
#!/bin/bash
print_gems() {
awk '/([[:alnum:]_]+) \(/{ print $1 }' Gemfile.lock | sort -u
}
count() {
grep -c ^
}
if [ "$1" == "-c" ]; then
print_gems | count
else
print_gems
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment