Gemfileの最新gemの日付を自動取得
#!/bin/bash
cat Gemfile | grep -v '#.*gem\s' | grep -Eo 'gem\s.*' | sed 's/gem//g' | sed 's/,.*//g' | sed 's/"//' | while read line; do
curl curl https://rubygems.org/api/v1/versions/{$line}.json | python -mjson.tool | grep -e created_at -e number -m2 | awk 'if(NR%2)ORS="\t";else ORS="\n";print}' |awk -v GEM=$line '={ print substr($2, 2, 10) } "->" GEM "の最新gem\(" $4 $5 "\)" ' >> gem_versions.txt
done