-
-
Save lsantosc/3baf2f8db9d2c6e9a96c8b45296cd729 to your computer and use it in GitHub Desktop.
List all the different gems on your Gemfile.lock
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
| #!/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