Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 27 lines (14 sloc) 0.548 kb
59a05fc @wayneeseguin Added contrib/gemset_snapshot script.
wayneeseguin authored
1 #!/usr/bin/env bash
2
bdc09de @wayneeseguin Slight cleanup on gemset_snapshot
wayneeseguin authored
3 printf "\nBeginning snapshot of the current environment gem list into snapshot.gems\n"
4
59a05fc @wayneeseguin Added contrib/gemset_snapshot script.
wayneeseguin authored
5 file_name="snapshot.gems"
bdc09de @wayneeseguin Slight cleanup on gemset_snapshot
wayneeseguin authored
6
7 gems=($(gem list | sed 's#[\(|\)]##g' | sed 's#, #,#g' | \tr ' ' ';'))
8
9 for gem in "${gems[@]}" ; do
10
2562019 @richo Continue awk annihilating rampage
richo authored
11 name="${gem%%;*}"
bdc09de @wayneeseguin Slight cleanup on gemset_snapshot
wayneeseguin authored
12
2562019 @richo Continue awk annihilating rampage
richo authored
13 versions=${gem#*;}
14 versions=(${versions/,/ })
bdc09de @wayneeseguin Slight cleanup on gemset_snapshot
wayneeseguin authored
15
16 for version in "${versions[@]}" ; do
17
32774ab @wayneeseguin Bugfix: matching in 18 compatible ruby based on new grep. Plus more clea...
wayneeseguin authored
18 echo "$name -v$version" >> "$file_name"
bdc09de @wayneeseguin Slight cleanup on gemset_snapshot
wayneeseguin authored
19
59a05fc @wayneeseguin Added contrib/gemset_snapshot script.
wayneeseguin authored
20 done ; unset version versions
bdc09de @wayneeseguin Slight cleanup on gemset_snapshot
wayneeseguin authored
21
59a05fc @wayneeseguin Added contrib/gemset_snapshot script.
wayneeseguin authored
22 done ; unset file_name
23
bdc09de @wayneeseguin Slight cleanup on gemset_snapshot
wayneeseguin authored
24 printf "\nCompleted snapshot of the current environment gem list into snapshot.gems\n"
25
59a05fc @wayneeseguin Added contrib/gemset_snapshot script.
wayneeseguin authored
26 exit $?
Something went wrong with that request. Please try again.