Skip to content

Commit

Permalink
scripts to list and fetch rubies
Browse files Browse the repository at this point in the history
  • Loading branch information
mindscratch committed Nov 1, 2014
1 parent c989ee0 commit 58a8989
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/fetch_rubies.sh
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

scriptDir="$( cd "$( dirname "$0" )" && pwd )"
source "${scriptDir}/ruby_vars.sh"

rubyVersion="$1"
echo "url: $rubyUrl"
echo "version: $rubyVersion"

wget --no-check-certificate "${rubyUrl}/ruby-${rubyVersion}${rubyExt}"
9 changes: 9 additions & 0 deletions scripts/list_rubies.sh
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

scriptDir="$( cd "$( dirname "$0" )" && pwd )"
source "${scriptDir}/ruby_vars.sh"

curl -s "${rubyUrl}/" \
| grep "<a href=\".*ruby-.*\.tar\.bz2" \
| sed -e 's/<a .*href=['"'"'"]//' -e 's/["'"'"'].*$//' -e '/^$/ d' \
| sed -n 's/\.tar\.bz2//p'
3 changes: 3 additions & 0 deletions scripts/ruby_vars.sh
@@ -0,0 +1,3 @@
rubyUrl="http://cache.ruby-lang.org/pub/ruby"
rubyExt=".tar.bz2"

0 comments on commit 58a8989

Please sign in to comment.