Skip to content

Instantly share code, notes, and snippets.

@brettporter
Last active December 16, 2015 16:39
Show Gist options
  • Save brettporter/5464167 to your computer and use it in GitHub Desktop.
Save brettporter/5464167 to your computer and use it in GitHub Desktop.
#!/bin/sh
gem_dir=/tmp/gem-grab
gem_repo=http://my.gem.repo
set -e
gem list --source $gem_repo -r -a -u --prerelease | awk '/^[a-z]/' | while read t1
do
name=`echo $t1 | perl -n -e '/^([^\s]+)/ && print $1'`
echo $t1 | perl -n -e '/\((.*)\)/ && print $1' | tr ',' '\n' | sed 's/^ //' | while read version
do
echo Fetching $name $version
GEM_HOME=$gem_dir gem install --source $gem_repo --no-ri --no-rdoc --ignore-dependencies -v $version $name
done
done
zip -j gems.zip $gem_dir/cache/*.gem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment